I always use 4 parameters in my setcookie(cookie_name,cookie_value,time,"/")
Also, verify that $HTTP_POST_VARS['Name'] exists by printing it
----- Original Message ----- 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 13, 2003 7:20 AM
Subject: Re: [PHP] cookie problem....


On Thursday 13 February 2003 16:07, Terry Lau wrote:
> Hello,
>     I created a PHP page that included cookie, here is the PHP code:
> <?php
> if (isset($HTTP_POST_VARS['Name'])) {
> setcookie("Name", $HTTP_POST_VARS['Name'], time()+86400*10);
> }

[snip]

> But when I called the cookie variable in another page, it showed
> "Notice: Undefined index: Name in....". Here is the PHP code in another
> page:
>
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
>
> <body>
> HI!! <?php echo $HTTP_COOKIE_VARS['Name']; ?>
> </body>
> </html>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to