|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Why won't this count?!
I must be missing something simple, can someone tell me why this script WILL NOT count upward? It's as though it simply ignores the $rem variable! The feed is from a page called login.php, and it passes the $auth variable and the $rem variable. For some reason, though, this ALWAYS outputs "Attempt 2 of 3." Li'l help?
Thanks, -Adam $password = "password1"; if (!isset($rem)) { $rem = "2"; } else { $rem++; } if (!isset($auth)) { echo "<font color=red>Attempt $rem of 3...</font>n"; echo "<form method=post action=authorize.php>n"; echo "Please enter a password <input type=password maxsize=100 name=auth>n"; echo "<p>"; echo "<input type=submit value="Enter">n"; echo "</form>"; echo "<p><p>"; } elseif ($auth != $password) { echo "<font color=red>Attempt $rem of 3...</font>n"; echo "<form method=post action=authorize.php>n"; echo "Please enter a password <input type=password maxsize=100 name=auth>n"; echo "<p>"; echo "<input type=submit value="Enter">n"; echo "</form>"; echo "<p><p>"; } else { //do this stuff... } ?> |
|
#2
|
|||
|
|||
|
RE: Why won't this count?!
Well, the first thing I would do is check the register_globals value in your php.ini. If it is set to off, you are not going to see that $rem variable. In fact, are you seeing that $auth variable? What I would do is move over to using $HTTP_POST_VARS to address those two variables. It is much more secure any how. Right now as it stands, anyone can fake the $rem value in your script by simply changing its value in the URL.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Why won't this count?! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|