This is kinda tough to describe.
- I have a jump menu on a page.
- The url var set by the Jump menu should set/change a cookie
- What’s happening, as I click through the Jump menu, is that the cookie value is always ONE BEHIND the actual URL var.
[php]
if(isset($_GET[“calid”])) {
setcookie (“cookie_CalID”, “”, time() - 3600); // clear out the old value
setcookie(“cookie_CalID”, $_GET[“calid”]); }
echo "COOKIE =".$_COOKIE["cookie_CalID"]."<br>";
echo "URL = ".$_GET["calid"];
[/php]
So, for the urls below, the code above will show:
-
mypage.php?calid=2
… Cookie = (whatever the default value is)
… URL = 2 -
mypage.php?calid=3
… Cookie = 2
… URL = 3 -
mypage.php?calid=4
… Cookie = 3
… URL = 4 -
mypage.php?calid=2
… Cookie = 4
… URL = 2
What the heck??? Ideas?