You are here: setcookie() help please « All PHP « IT news, forums, messages
setcookie() help please

Posted by - Dazed on 09/28/79 11:44

when I call set_css_color.php by:
code:
$colorloc = "".getenv('REQUEST_URI')."";
echo"<a
href=\"$DOCUMENT_ROOT/set_css_color.php?color=gray&url=$colorloc\">gray</a>\n";

and the contents of set_css_color.php is:
<?
$colorcookietime=time()+(3600*24*356);
$cookiepath="/";
setcookie("CSS_COLOR", $color, $colorcookietime, "$cookiepath");
header("Location: $url");
?>

the value of the cookie seyt is "gbyy" instead of "gray"

If I call it by:
code:
$colorloc = "".getenv('REQUEST_URI')."";
echo"<a
href=\"$DOCUMENT_ROOT/set_css_color.php?url=$colorloc\">gray</a>\n";

and the contents of set_css_color.php is:
<?
$colorcookietime=time()+(3600*24*356);
$cookiepath="/";
setcookie("CSS_COLOR", "gray", $colorcookietime, "$cookiepath");
header("Location: $url");
?>

the value of the cookie set is "gray", as expected

Can anyone shed a clue as to why the cookie gets set to "gbyy" in the
first example instead of "gray"?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация