I create a login page creating at first the controller using codeigniter php and loading the view. When I login in the page the url …/login doesn’t change in index (that is the page loaded) but remain login. how can I change in this way when I login correctly the url became /index?
Share
After the login was successful, you can use
redirect('controller/method');to redirect the user where you want.Don’t forget that to be able to use
redirectfunction, you should have loaded the url helper in controller’s__construct()method or inconfig/autoload.phpfile to call the helper in the entire application.How to load url helper in
__construct()function?Or you can load it just after successfull login in
login()method.Take a look at http://codeigniter.com/user_guide/helpers/url_helper.html for more information.