I have a problem with the passing of variables using URL. I have two pages. One is a login page and the other is an action page for the login. If the login fails, the action page will redirect the user back to the login page with a
$ref = $_SERVER['HTTP_REFERER'];
header("Location: ".$ref."?login=failed");
Thus, the above will redirect the user to http://www.somesite.com/login.php?login=failed
However, if the user fails the login process again, the page will redirect the user to http://www.somesite.com/login.php?[b]lo ... gin=failed[/b]
If he fails three times, the ?login=failed will be displayed THREE times and so on.
This is incorrect. I just want ?login=failed to be passed ONCE despite how many times the user fails his login authentication.
What have I done wrong in the code? Kindly advise pls. Thank you so much!