cookie problem..
| From: | Terry Lau | Date: | Sat, 22 Feb 2003 06:17:44 +0000 |
| Subject: | cookie problem.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136608@lists.php.net to get a copy of this message | ||
Hello,
I want to set a cookie when I enter a text into the text field, and it shows the text I submitted immediately, thus I write a sample php code like this:<?php if (isset($HTTP_POST_VARS['Name'])) { setcookie("name", $HTTP_POST_VARS['Name'], time()+86400*10); } echo $name; ?> (I set the text field is Name and the data will be sent to another page) In another page, I insert <?php echo $HTTP_COOKIE_VARS['name']; ?> in the beginning of the code. Is the code right? Then I run the test, I enter a name into the text field and submit it. But it shows "Notice: Undefined index: name in ..", it can't show the name I submitted. Why?Anything wrong?? Thanks!!
Terry_________________________________________________________________ 今日星座 http://www.msn.com.hk/fortune/west/ 運程