I wonder if some kind PHP programmer can point out the error here.
Simple (hopefully) PHP problem
7
I wonder if some kind PHP programmer
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
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
- imarketstuff
- [1] reply
- Harvey Segal
- SteveJohnson
- [1] reply
- Harvey Segal
- Oliot
- [1] reply
- Harvey Segal
Next Topics on Trending Feed
-
7