note 9105 added to Classes and Objects
| From: | mfischma at yahoo dot com | Date: | Tue, 17 Oct 2000 08:25:48 +0000 |
| Subject: | note 9105 added to Classes and Objects | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6557@lists.php.net to get a copy of this message | ||
I was trying to check a cookie in a class function and I noticed the following about
HTTP_COOKIE_VARS.
class a {
function r() {
$cookieValue=$HTTP_COOKIE_VARS["aCookie"];
}
}
the above will not set the value of aCookie to $cookieValue, but ...
class a {
function r() {
$cookies=$GLOBALS["HTTP_COOKIE_VARS"];
$cookieValue=$cookies["aCookie"];
}
}
would set the value of the cookie aCookie to $cookieValue. I am assuming that all the preset
variables act as global variables within a class function. If you have any trouble with any preset
variables or HTTP variables, tryout the above.
http://www.php.net/manual/language.oop.php