Re: hide elements on page based on cookie
| From: | Torsten Roehr | Date: | Wed, 21 Jul 2004 12:23:58 +0000 |
| Subject: | Re: hide elements on page based on cookie | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191305@lists.php.net to get a copy of this message | ||
"Msa" <melissa@maddesignusa.com> wrote in message
news:20040721121742.97323.qmail@pb1.pair.com...
> no, I am not sure of that.....I played with that code snippet from someone
> else. how do I check for the value instead? would the reason why they
> aren't working be because of checking for length and not value?
>
> >
> > Are you sure you want to check the string length of the cookie instead
of
> > its value?
> >
> > Regards, Torsten Roehr
You wrote you have three states, so the three condition should be:
// secure
if (isset($_COOKIE['levelCookie'] && $_COOKIE['levelCookie'] === 1)) {
}
// sales
if (isset($_COOKIE['levelCookie'] && $_COOKIE['levelCookie'] === 2)) {
}
// secure
if (!isset($_COOKIE['levelCookie')) {
}
Try if this is what you want.
Regards, Torsten