Re: Test for Cookies
| From: | Hardy Merrill | Date: | Wed, 24 Jan 2001 17:04:57 +0000 |
| Subject: | Re: Test for Cookies | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-36435@lists.php.net to get a copy of this message | ||
Karl J. Stubsjoen [karlflips@kstub.com] wrote:
> Hi,
>
> I need to test for cookies. What is the simplest way to do this?
Be a little more specific - do you want to know if there
are cookies at all, or if there are specific cookies?
Depends on the settings in the Data Handling section of your
php.ini. With register_globals = On and track_vars = On, I
can do this:
if (sizeof($HTTP_COOKIE_VARS) == 0) {
error_log("no cookies!!!");
}
or
if (empty($HTTP_COOKIE_VARS["my_cookie_1"])) {
error_log("my_cookie_1 doesn't exist!");
}
HTH.
--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com
>
> Thanks - Karl
>
>
> --
> 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