Redirection to last url??

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I want my site to send users back to where they were prior to being told
they have to login. For instance, say user accesses page1.php. They try to
do something and they get a message telling them to login. So they login,
which is done at login.php. After they log in, I want them to end up back at

Any idea how to do this?



Re: Redirection to last url??

Quoted text here. Click to load it

IMHO most often used:

 if logged in: the content of
 if not      : redirect to

respons: authenticate user
 if autheticates and oldurl exists: redirect to $_GET['oldurl']
 if autheticates and oldurl misses: redirect to loggedin.html
 else get authentication

Site Timeline