CodeIgniter Forums

Full Version: Load the view user was at
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

In my CodeIgniter based website, my sidebar has the login box.

In the login controller, I have the following code:

if ($this->form_validation->run() == FALSE)
Currently, in case of a failed login, it redirects to loginfail view.

What I want to do is send the user back to the view he was at. But since the login box is in a sidebar which is loaded onto every other view, how can I know which view the user was at?