Re: password-protecting with PHP, help plz
| From: | John Taylor-Johnston | Date: | Mon, 20 Sep 2004 05:28:37 +0000 |
| Subject: | Re: password-protecting with PHP, help plz | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197244@lists.php.net to get a copy of this message | ||
Parse error: syntax error, unexpected T_BOOLEAN_AND in c:\TSW\pages\testing2.php on line 3
My code should do what you want? It uses authenticate? Any how :) I think you are missing acouple of
brackets?
if (
($_POST['user'] == 'Andrew') && ($_POST['pass'] ==
'pass')
)
{
echo "Welcome, Andrew.";
}
AceZero2790@aol.com wrote:
> Now moving on to using password protecting with more than one factor.
>
> I'm trying to figure out how to password protect with more than two factors:
> username and password. Here's the form:
>
> <?php
> echo <<<_HTML_
>
> <form method="post"
> action="http://www.thesonicworld.net/pages/testing2.php">
> Username: <input type="text" name="user"><br>
> <form method="post"
> action="http://www.thesonicworld.net/pages/testing2.php">
> Password: <input type="text" name="pass">
> <br>
> <center><input type="submit" value="Log In"></center>
> </form>
>
> _HTML_;
> ?>
>
> And here is the action page, testing2.php.
>
> if ($_POST['user'] == 'Andrew') && ($_POST['pass'] ==
> 'pass') {
> echo "Welcome, Andrew."; }
>
> And (shocker!) I got a blank page. So I turned out display errors and got
> this:
>
> Parse error: syntax error, unexpected T_BOOLEAN_AND in
> c:\TSW\pages\testing2.php on line 3
>
> Line 3 being the line with the && stuff. I'm not sure if the whole &&
> thing
> is right...obviously not. How do I password protect with more than one factor?
>
> -Andrew
John