I'm trying to create a theme system. Where a cookie is placed with a theme of their choice. than when the $theme var is called it will detect it from the cookie and load the correct them. this is what i got... not sure why it's not working.
//settheme.php
switch ($theme) :
case("red") :
setcookie("theme", red, (time() + (3600 24 365 10)), "/");
header("Location: $HTTP_REFERER");
break;
case("green") :
setcookie("theme", green, (time() + (3600 24 365 10)), "/");
header("Location: $HTTP_REFERER");
break;
case("orange") :
setcookie("theme", orange, (time() + (3600 24 365 10)), "/");
header("Location: $HTTP_REFERER");
break;
default:
setcookie("theme", blue, (time() + (3600 24 365 10)), "/");
header("Location: $HTTP_REFERER");
endswitch;
it will only set $theme as "blue" and i don't know why. thanks!