|
Posted by - Dazed on 04/10/06 07:08
- Dazed <user@name.com> wrotc:
>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"?
Found a fix;
changed:
set_css_color.php?color=gray&url=$colorloc
to
set_css_color.php?newcolor=gray&url=$colorloc
and changed:
setcookie("CSS_COLOR", $color, $colorcookietime, "$cookiepath");
to
setcookie("CSS_COLOR", $newcolor, $colorcookietime, "$cookiepath");
Navigation:
[Reply to this message]
|