Page 1 of 1

header('Location: '.$_SERVER['HTTP_REFERER']); not working..

Posted: Fri Nov 09, 2007 3:42 pm
by JAB Creations
This...

Code: Select all

header('Location: '.$_SERVER['HTTP_REFERER']);
...isn't working.

Lets say I am on page2.php. I click the sign-out script link which brings me to sign-out.php. Instead of redirecting me to the page I was on (page2.php) I get redirected to page1.php. I didn't sign-out on page1.php...I signed out on page2.php. I just want to get this to work please. :D

Posted: Fri Nov 09, 2007 4:29 pm
by feyd
Considering HTTP_REFERER isn't reliably set, I wouldn't use it.

Set the (proper) URL in a session variable.