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


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.

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?

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.

Aww how come I never thought of that?

Thanks xwero.

Theme © iAndrew 2016 - Forum software by © MyBB