$skin = $_GET['skin'];
if ($skin != "")
{
setcookie('style', $skin, time() + 3600);
echo "<p>Skin has been set to \"${skin}\"... You will see the changes when you next click on a link.</p>";
}
I use that script just after my <head> tag. Next, I put:
<title>Title of my site here (hidden for privacy reasons)</title>
<LINK REL=StyleSheet HREF=\"";
if ($HTTP_COOKIE_VARS['style'] == "redtyu")
{
echo "red.css";
}
elseif ($HTTP_COOKIE_VARS['style'] == "greenhjk")
{
echo "green.css";
}
if ($HTTP_COOKIE_VARS['style'] == "yellowuio")
{
echo "yellow.css";
}
if ($HTTP_COOKIE_VARS['style'] == "mysteryzxc")
{
echo "mystery.css";
}
else
{
echo "stylesheet.css";
}
Now, I know that $_GET['skin'] gets the right thing, I've echoed it out.
After typing "javascript:alert(document.cookie);" into the URL, it appears that the cookie is not being saved. I have my security settings to "Accept all cookies".
EDIT- Forgot to say that I know my host is not prohibiting cookies in any way.
I'm stuck now, please help, thankyou. 🙂