Re: Storing data about login in cookies
| From: | Richard Lynch | Date: | Mon, 08 Jan 2001 06:31:26 +0000 |
| Subject: | Re: Storing data about login in cookies | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33195@lists.php.net to get a copy of this message | ||
You need *two* = signs to test equality. Just one = does an assignment.
So, your if() statement was *always* changing $login to "loggedin" and then
*always* returning TRUE.
You need if($login == "loggedin"){....
----- Original Message -----
From: "MacBane" <morgan@amnesia.com.au>
Newsgroups: php.general
Sent: Sunday, January 07, 2001 11:28 PM
Subject: [PHP] Storing data about login in cookies
> <?php
> $login = $HTTP_COOKIE_VARS["CMSlg"];
>
> Im having trouble with this code it appears that it won't work with at the
> if statment
>
>
> print "$login";
>
> if ($login = "loggedin")
>
> {
>
> $msg = "<P>Congratulations, you log in!</p>";
>
> }
>
> else {
>
> $msg = "<P>die</p>";
>
> };
>
> print "$msg";
> ?>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>