Image

Imagethegreat271 wrote in Imagephp

Listens: metallica

cache problem? - retreiving and using cookies..

I am making a script to set the style of a given page depending on the
value of a variable using cookies as to retain the info upon next
visit. I have included code below that is nothing really.. but, it's
enough to show what the problem is. when I use this, on the index.php
page, it only shows the previous entry for $value and not the new one..
I know of one way to do this is just to add a random number on the end
of index.php ie. index.php?66666653423 or whatever. I was wondering if
there is a better way to do this, as I've seen other sites such as
http://nion0.com which do this without apparently having any random
integers. Thanks in advance..


note:

so far, this is a problem in internet explorer and not Firefox if that helps anyone.








<u>Set cookies:</u>

< ?php





setcookie("TestCookie", $value);


setcookie("testcookie");








header("Location: index.php");


   exit;











? >





<u>retrieve (index page)</u>



< ?php

// Print an individual cookie

echo $_COOKIE["TestCookie"];



? >