(Before I even start I just want to say that I have checked the PHP manual, two separate PHP books one magazine and this forum regarding my problem and have not found a satisfactory answer)
Hi,
this is quite a simple problem, but it's got me stumped.
I'm trying to give a user 5 attempts to enter a username and password.
A portion of the script that I've created is as follows;
PHP:
//if the user has entered a valid username and password...
print "Welcome $fname $lname. Your email address is $email. Your password is $password. You are now logged on!";
} else {
$trys=1;
while ($trys<=5) {
$allowed=5;
echo "You failed to enter a valid username and password. Please try again.<br>";
$trys++;
//then it draws up a form and lets the user try again.
if ($trys>$allowed) {
print "You have had used up your five attempts. Hit the bricks!";
}
As you can imagine... that doesn't work. It just prints the "try again" message four times then prints the "hit the bricks" message at the bottom. It then draws up the form, but filling it out and sending it makes no difference to the output.
Last edited by Davidc316 on 07-15-2003 at 01:02 AM