Re: password-protecting with PHP, help plz
| From: | Janet Valade | Date: | Sun, 19 Sep 2004 20:10:44 +0000 |
| Subject: | Re: password-protecting with PHP, help plz | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197218@lists.php.net to get a copy of this message | ||
AceZero2790@aol.com wrote:
You were right, my display_error function was turned off. I turned it on and get this: Parse error: syntax error, unexpected T_IS_EQUAL in c:\TSW\pages\testing2.php on line 3 So it isn't working. How do I get to let me make comparisons between the post data and something else? I figure if I can get it so that this will work, it'll be an easy way to password protect my pages... -AndrewThe syntax is: if (comparison){ You have: if ($_POST['user']) == me { Part of your comparison is not inside the parentheses. You need to have: if ($_POST['user'] == me) { Also, your string isn't quoted. That's not causing the parse error in this message, but will cause a problem after you fix your parentheses. (e.g., "me"). Janet