if ($mbrQ->errorOccurred()) { displayErrorPage($pass_user); } $mbr = $mbrQ->fetchMember(); if ($mbr == false) { # invalid password. Add one to login attempts. $error_found = true; $pageErrors["pass_user"] = "******"; if (!isset($_SESSION["loginAttempts"]) || $_SESSION["loginAttempts"] == "") { $sess_login_attempts = 1; } else { $sess_login_attempts = $_SESSION["loginAttempts"] + 1; } # Suspend userid if login attempts >= 3 if ($sess_login_attempts >= 3) { $mbrQ->getStatus($mbr); $mbrQ->close(); header("Location: suspended.php"); exit; } } $mbrQ->close(); } #**************************************************************************** #* Redirect back to form if error occured #**************************************************************************** if ($error_found == true) { $_SESSION["postVars"] = $_POST; $_SESSION["pageErrors"] = $pageErrors; header("Location: ../user/index.php"); exit;