i've been trying to create a page that will stamp a cookie and redirect to our home page
cookie name: ezrefer
page name
ie: http://ww.anydomain.com/ezb.php?ezrefer=REFERCODE
REFERCODE is the code i want to stamp for this user depending on where they came from. so REFERCODE will change all the time.
but when i type the following code, no cookie is set because I HAVE TO put a value for $name, correct?
basically i don't want the cookie "ezrefer" to always be a static value.
is this possible?
<?php
$today = date("F j, Y, g:i a");
$name = "";
setcookie("ezrefer-$today",$name,time()+31536000,"/", ".ezboard.com");
$URL="http://www.ezboard.com";
header ("Location: $URL");
?>
thanks in advance...
- Randy -
Cookie Setting
Moderator: General Moderators
would i be able to change the value of "ezrefer-$today" according the url? like if i type this in the url:
http://www.anydomain.com/myphp.php?ezre ... y=ANYVALUE
would i be able to set the ezrefer-$today value to that just by typing that in the url?
http://www.anydomain.com/myphp.php?ezre ... y=ANYVALUE
would i be able to set the ezrefer-$today value to that just by typing that in the url?
How about myphp.php?date=ANYVALUE :
Code: Select all
$cookie_value = "PHP rules!";
$today = $_GET['date'];
$cookie_name = "ezreferer-$today";
setcookie($cookie_name,$cookie_value);