"Notice: Undefined index: Message in C:\Inetpub\armcircles\htdocs\ben\php\final\login.php on line 4"
The code for the login.php:
Code: Select all
<?php
$PageTitle = "Login Page";
require("header.php");
if ($_GET['Message'] == "Invalid"){
print("<B><CENTER><FONT COLOR= RED>Login Error:</B> The username and password you entered does not match what is on file. Please try again!</FONT></CENTER>\n");
}
print("<FORM ACTION="HandleLogin.php" METHOD=POST>\n");
print("Username: <INPUT TYPE=TEXT NAME=UserName><BR>\n");
print("Password: <INPUT TYPE=PASSWORD NAME=Password><BR>\n");
print("<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE="Submit">\n");
require("footer.php");
?>A bit on the code: Basically it's a login script. HandleLogin.php basically just takes the user input and checks to see if it's a valid username and password. If it is, it tosses the user to index.php. If not, it returns them back to login.php with $message = invalid.
the basic idea, which isn't too complex, is that if login.php loads up and $message = invalid, then i want the error message to display. this works quite well. my problem is when there ISN'T a $message in existance, PHP still errors out, even though I just want it to "ignore" the if statement if there isn't a $message. does anyone know the reason behind this? is it a server setting? thanks for any help you can give me.