VitaminWater
10-30-2008, 09:51 PM
Im trying to alter my section of code so that when i user enters an invalid username or password it displays "invalid" on the same page, and not a new page. i am trying to use a boolean variable to do this, here is my code on the login section.
$failPass = false;
if ($failPass == true){
echo'Error';
}else if($_SESSION['LOGGED_IN'] == true) {?>
I cut the code off to place only the relevant parts.
On the loginauth page i have this code written.
if ($num_rows <= 0) {
header('Location: index.php');
$failPass = true;
exit;
} else {
However, when the loginauth redirects back to the first page, it does not display "error"
Please help guide me.
$failPass = false;
if ($failPass == true){
echo'Error';
}else if($_SESSION['LOGGED_IN'] == true) {?>
I cut the code off to place only the relevant parts.
On the loginauth page i have this code written.
if ($num_rows <= 0) {
header('Location: index.php');
$failPass = true;
exit;
} else {
However, when the loginauth redirects back to the first page, it does not display "error"
Please help guide me.