so here i am with “maybe another stupid question”
so here i want to ask how to redirect to previous page if the case is somehow like this:
i have view:
a. home_view b. about_view c. contact_view
then i have login view that (now currently after i login it’ll redirect me into the home_view)
I want if i access login_view from about_view then the redirect function will redirect me to about_view, or if i access login_view from contact_view then the redirect function will redirect me to contact_view and so on. How to make redirect function to the previous page(not a single page) ? Maybe some tricks using php? or codeigniter itself?
It’s simple when you have login and you go to login_view just set default redirect to about_view or contact_view when had login.
But if you want to redirect to previous page you have to trick with session must set session ex :
$SESSION['last_view'] = $yourlastview;. $yourlastview can be set when you in about_view or contact_view or another view and when you go to login_view just check that$SESSION['last_view']and redirect to that view.Regard’s
Jefri