hello.. I am just testing a simple PHP password/verify form... and I don't know why its not working. I am new to PHP but I have looked at other sample codes and mine seems to be okay in my eyes...
I have two files... password.html and password.php.
password.html looks like this:
<html>
<head>
<title> Password Script </title>
</head>
<body>
<center>
<form name="form1" method="post" action="password.php">
<input name="username" type="text" id="username">
<p>Enter your First Name Please</p>
<input type="submit" name="Submit" value="Submit">
</form>
</center>
</body>
</html>
and password.php looks like this:
<?php
if ($username == "Rob")
{
print "Yay, Rob you are logged in!";
}
else
{
print "I am sorry the password is incorrect. Please go back and try again";
}
?>
Now when I enter Rob as the name, i STILL get "I am sorry the password is incorrect. Please go back and try again" ... I don't understand why this is happening. No matter what I put as the password in the form, I still get the I am sorry message. Please help... this is probably something really simple but I'm just too new at this to catch it. The server is running PHP 4.3.4 and is hosted with OSX Panther Server 10.3.
I just want to be able to create small password frms, where someone can enter a password and proceed to the next page.
try it for yourself http://www.impassible.com/documents/learnphp/password.html
Thanks alot...