Hi all, I am developing a script to handle logins, at the moment I have the password and username in in the script but when I get this working I will import the pass & username from a database or file but at the minute the script doesn’t work can anybody see the problem. This script runs first and is called login.php
and then calls this one handleLogin.php.
thx in advance
To err is human, to completely mess up takes a computer.
Code:
<?php
$PageTitle = "Login Please";
require("header.php");
if($message == "Invalid") {
print("<B><CENTER><FONT COLOR=RED>The Username and password do not match please try again!</FONT>
</CENTER></B>\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");
?>
and then calls this one handleLogin.php.
Code:
<? php
if(($UserName == "tony") && ($Password == "tony")) {
header("Location: index.php?UserName=$UserName");
exit;
} else {
header("Location: login.php?message=Invalid");
exit;
}
?>
thx in advance
To err is human, to completely mess up takes a computer.