Redirecting user after logging in [SOLVED] |
[eluser]KeyStroke[/eluser]
Hi, I basically have a site where some sections requires the user to login. The problem is that I don't know how redirect users back to the page they were in before logging in. Example: if www.example.com/index.php/new_post is restricted, they should be redirected to www.example.com/index.php/login to login, then sent back to www.example.com/index.php/new_post again after they successfully login. Any idea?
[eluser]xwero[/eluser]
add the url before redirection to the session and when the login succeeds you check if an redirect url is found in the session and redirect or not depending on that check.
[eluser]KeyStroke[/eluser]
Aww how come I never thought of that? Thanks xwero. |
Welcome Guest, Not a member yet? Register Sign In |