Page 1 of 1

referral page

Posted: Mon Mar 31, 2003 9:11 pm
by theclay7
I am writing a forum add, f_add.php where it will check if the person has already login or not, if no, then it will go to the login page and then going back to the previouse f_add.php...

my problem is when the f_add.php directs the user to login.php, I use $_SERVER['HTTP_REFERER'] to remember the page it comes in, but it is not the f_add.php page but the page i visited before f_add.php....

so how can I implement this, so the user can login and redirect to the page they have requested?

Posted: Mon Mar 31, 2003 10:51 pm
by Malder
You can use somth like this:

//f_add
...
header('login.php?prev=f_add.php');

//login
...
if isset('{$_GET["prev"]}') header('{$_GET["prev"]}');