RE: [PHP] Cookies
| From: | Jan van Schaijk | Date: | Wed, 01 Nov 2000 00:14:48 +0000 |
| Subject: | RE: [PHP] Cookies | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-23276@lists.php.net to get a copy of this message | ||
Well,
I don't get it exactly: if the user enters my page again, what will happen
then?
Jan
-----Oorspronkelijk bericht-----
Van: Andrew Rush [mailto:andy@mainetoday.com]
Verzonden: woensdag 1 november 2000 22:46
Aan: Jan van Schaijk
Onderwerp: Re: [PHP] Cookies
you are trying to read a cookie from the same page that sets it, which can't
be done. after the cookies are set, refresh the user to a new page that runs
the rest of the code.
On Tuesday, October 31, 2000, at 03:12 PM, Jan van Schaijk wrote:
> Hi,
>
> why is the following code invalid?
>
> --------
>
> <?
> if (!$count) { setcookie ("count", "1"); }
> if (!$phone) { setcookie ("phone", "false"); }
> if (!$sort) { setcookie ("sort", "false"); }
> if (!$language)
> if (strstr($HTTP_ACCEPT_LANGUAGE,"nl")) { setcookie
> ("language","nl"); }
> else { setcookie ("language","en"); }
> }
> echo $HTTP_COOKIE_VARS["phone"];
> ?>
>
> <HTML>
> (...)
>
> Hello visitor, you have seen this page <? $count++; echo $count; ?>
> times.<p> <?
>
> ------------
>
> It's in the beginning of the file.
>
> Jan
>
>
> --
> 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
>
>