CodeIgniter Forums
Load the view user was at - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Load the view user was at (/thread-45824.html)



Load the view user was at - El Forum - 10-07-2011

[eluser]xbonez[/eluser]
In my CodeIgniter based website, my sidebar has the login box.

In the login controller, I have the following code:

Code:
if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('loginfail');
        }          
        else
        {
            $this->load->view('loginsuccess');
        }
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?