PDA

View Full Version : Dynamically setting cookies


Lionel
09-24-2005, 07:45 PM
Can cookies be set dynamically?
I have this:


if ($_GET['add'] == "yes")
{
$value = '<a href=view.php?id=$id>$mycompany</a>';
setcookie("mycookie", $value, time()+29030500);

it returns

$mycompany as the cookie value

and when I set the cookiename as $mycompany instead of mycookie, nothing happens.

pyro.699
09-25-2005, 12:37 PM
Imm not a genious on this, but shouldent the time be inside the brackets?


if ($_GET['add'] == "yes")
{
$value = '<a href=view.php?id=$id>$mycompany</a>';
setcookie("mycookie", $value, time(+29030500));