Re: Cookies and Variables
| From: | Mike Eheler | Date: | Wed, 21 Nov 2001 00:03:46 +0000 |
| Subject: | Re: Cookies and Variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75329@lists.php.net to get a copy of this message | ||
$HTTP_COOKIE_VARS['someWord'];
$HTTP_GET_VARS['someWord'];
:P
Mike
Richard S. Crawford wrote:
Consider this code, in page1.php: <?phpsetcookie("someWord","I am a cookie");?> ...and this code, in page2.php: <?phpsetcookie("someWord",$someWord); print ("someWord says: $someWord"); $someWord = "I am a variable"; print ("< a href=\"page2.php?someWord=$someWord\" >Click here< /a >");?> (In the actual code, the value of $someWord is passed via POST through a form, but the principle is the same.) The first time I load page2.php, the output should be:someWord says: I am a cookieWhich, of course, works perfectly. But each subsequent time I load page2.php, I want the output to be:someWord says: I am a variableand then set the value of the cookie "someWord" to "I am a variable". But that's not what happens. Everytime I load page2.php, someWord tells me that it is a cookie. How do I get the value of the variable to override the value of the cookie? Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: underpope@hotmail.com "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!"