Log in

View Full Version : Boolean Problems



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.

Nile
10-31-2008, 01:18 AM
Your not sending any post data back to the page, your only putting a temporary variable. Search on google how to send post data in a header() if you can't find anything then look at ajax.