note 9105 deleted from Classes and Objects by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Tue, 17 Oct 2000 20:44:44 +0000 |
| Subject: | note 9105 deleted from Classes and Objects by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6585@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.