Re: basic set and read a cookie probs
| From: | Jack E. Wasserstein, DDS, Inc. | Date: | Thu, 25 Dec 2003 03:15:32 +0000 |
| Subject: | Re: basic set and read a cookie probs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173314@lists.php.net to get a copy of this message | ||
Sorry,
No such thing as $_POST_VARS
"Jack E. Wasserstein" <Jack@Wasserstein.com> wrote in message
news:20031225005706.11105.qmail@pb1.pair.com...
> I am using the following code on the php form handler
>
> if ($_POST[referdrremember] == "true") {
> setcookie("remailcookie",
>
> "$_POST_VARS[refdremail]",time()+3600,"/","wasserstein.com","0");
>
> Try to see the cookie in the same script, not sure which one to use with
or
> without $
>
> print " the cookie's value is $HTTP_COOKIE_VARS[remailcookie] ";
> print " the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ";
>
> In addition when I get back to the calling form and refresh it I try to
see
> the cookie with this:
>
> if ($HTTP_COOKIE_VARS[remailcookie]) {
> print ("remail cookie exists"); }
> else {
> print ("no cookie");
> }
>
> This yeilds "no cookie"
>
> I have also tried $_COOKIE[] as well
>
>
> What am I doing wrong.
>
> Thanks in advance,
>
> Jack