Simple (hopefully) PHP problem
can point out the error here.
I want to pass data (like an affiliate code) to a script
and display it but not let it overwrite any previous code
So
http://www.supertips.com/ztest.php?x=1
shows ==> 1
Followed by
http://www.supertips.com/ztest.php?x=2
shows ==> 2 but it should be 1
Here is the script
<?php
$cookie_name = "ztest";
if(!isset($_COOKIE['$cookie_name'])) {
$x = $_GET[x];
$cookie_value=$x;
$domain = ".supertips.com";
$expire = time()+60*60*24*30;
setcookie("$cookie_name","$cookie_value","$expire" ,"/","$domain",0);
}
echo "value= $cookie_value ";
?>
Thanks
Harvey
The 2nd Amendment, 1789 - The Original Homeland Security.
Gun control means never having to say, "I missed you."