
Originally Posted by
liyenn
but then when user submit the login form, $_SERVER['HTTP_REFERER'] will be override, is it?
No... the $_SERVER['HTTP_REFERER'] won't even affect your $_POST['return'] variable. You set the hidden variable on the previous page:
Code:
<input type="hidden" name="return" value="<?=$_SERVER['HTTP_REFERER']?>" />
This will be changed to something like this:
Code:
<input type="hidden" name="return" value="/previous_page.php" />
Since PHP will put the value of the variable in there. Then on the next page $_POST['return'] will be "/previous_page.php." It doesn't affect the server variable at all.
Bookmarks