Re: cookie problem

From: Date: Tue, 18 Jul 2000 19:11:01 +0000
Subject: Re: cookie problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7127@lists.php.net to get a copy of this message
$cookie is a local variable inside of the function call, You need to pass $cookie into the function like this: function check_cookie($cookie) { return isset($cookie); } echo check_cookie($cookie); echo "<br>" echo isset($cookie); Russell Uman wrote: > > having set a cookie, i run into the following odd behavior: > > function check_cookie() { > return isset($cookie); > } > > echo check_cookie(); > echo "<br>" > echo isset($cookie); > > i would expect to get the same response from each echo, however > check_cookie() always returns 0, whether or not the cookie is set. > > what extremely obvious mistake am i making here? > > thanks. > > -- > russell uman > russ@firebus.com > > -- > 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 -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.general (#7127) next »