I have a script called login.php which takes user information supplied via a form and checks whether the entered login information is valid. If the information is not valid, the following code is called:
$GLOBALS['user_login_fail'] = true;
header('Location: ../index.php'); //this displays index.html
In index.html, there is an error message that is shown if the user entered invalid login information:
<?php
if($GLOBALS['user_login_fail'] == true)
{
echo '<div> Login credentials could not be verified </div>';
}
else
{
echo "no error";
}
?>
However, after being redirected I get an error: Notice: Undefined index: user_login_fail. What's wrong here?