RE: [PHP-DB] Cookies
| From: | Kristian Duske | Date: | Tue, 26 Jun 2001 11:13:18 +0000 |
| Subject: | RE: [PHP-DB] Cookies | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9834@lists.php.net to get a copy of this message | ||
> this doesnt work :echo $HTTP_COOKIE_VARS["nameCookie"]
>
> code to set cookie: setcookie("newsLogin",$value,time()+ 3348000);
>
> if i ask from the same page I get the values I need but not from
> a different page...
You are asking the wrong variable name. If you set a cookie variable named
"newsLogin", you have to query it with $HTTP_COOKIE_VARS["newLogin"], or, if
you enabled track_vars, you can simply do it by $newsLogin. PHP gives you
all cookie, post and get variables as global variables in your scripts.
Kristian