redirect after login |
[eluser]Kraig[/eluser]
After doing what you said I still get the return_url to be "http://localhost:8888/ci/home/validate_credentials" no matter what page I am on. Here's how I implemented it into my controller: Code: class Home extends CI_Controller {
[eluser]Ayeyermaw[/eluser]
Ah right. I think you misunderstand. MY_controller is an extension of CI_controller. It's one file and you create it yourself then reference it in all your controllers. so instead of Code: class home extends CI_Controller { Code: class home extends MY_Controller { take a look at http://ellislab.com/codeigniter/user-gui...asses.html for an overview on extending the core classes
[eluser]Kraig[/eluser]
This is what I did and now I get a server error...I don't see any mistakes Code: <?php Code: class Home extends MY_Controller {
[eluser]Kraig[/eluser]
Server error The website encountered an error while retrieving http://localhost:8888/ci/home/. It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this webpage later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
[eluser]Kraig[/eluser]
When I change Code: class Home extends MY_Controller { Code: class Home extends CI_Controller { Code: <?php
[eluser]CroNiX[/eluser]
where is the location of your MY_Controller.php file? /application/core/ ?? That's where it should be if you extend a CI Core Class.
[eluser]Kraig[/eluser]
Ah, no it was in /system/core/ After moving it the script works now, but it still says that url is http://localhost:8888/ci/home/validate_credentials. I know the form is submitted through validate_credentials(), but the page that it is displayed on is home. How can I go about getting the "current controller", or controller before submission for lack of better words?
[eluser]CroNiX[/eluser]
You could create a hidden form element and put it there. Then it will get sent along with the form and you can check it when logging in.
[eluser]Kraig[/eluser]
Omg I don't know how I didn't think of that...I guess I was wondering if CI had a built in feature. Thank you!! Worked like a charm! Are you good with cookies? I'm trying to reset the config['sess_expiration'] when the user checks remember me and logs in with Code: $this->config->set_item('sess_expiration', 10); |
Welcome Guest, Not a member yet? Register Sign In |