Welcome Guest, Not a member yet? Register   Sign In
Redirecting user after logging in [SOLVED]
#1

[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?
#2

[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.
#3

[eluser]KeyStroke[/eluser]
Aww how come I never thought of that?

Thanks xwero.




Theme © iAndrew 2016 - Forum software by © MyBB