session_start(); if(isset($_GET['theme'])){ switch($_GET['theme']){ case "Red": $theme = 'Red'; $_SESSION['theme'] = $theme; setcookie("theme", $theme,time()+60*60*24*365); break; case "Blank": $theme = 'Blank'; $_SESSION['theme'] = $theme; setcookie("theme", $theme,time()+60*60*24*365); break; case "Black": $theme = 'Black'; $_SESSION['theme'] = $theme; setcookie("theme", $theme,time()+60*60*24*365); break; case "Blue": $theme = 'Blue'; $_SESSION['theme'] = $theme; setcookie("theme", $theme,time()+60*60*24*365); break; case "Pink": $theme = 'Pink'; $_SESSION['theme'] = $theme; setcookie("theme", $theme,time()+60*60*24*365); break; case "Silver": $theme = 'Silver'; $_SESSION['theme'] = $theme; setcookie("theme", $theme,time()+60*60*24*365); break; default: $_SESSION['theme'] = 'Blank'; } $redirectedtheme = $PHP_SELF; header("location: $redirectedtheme"); } if(isset($_COOKIE['theme'])){ $_SESSION['theme'] = $_COOKIE['theme']; $theme = $_COOKIE['theme']; } if(!isset($_SESSION['theme'])){ $_SESSION['theme'] = 'Silver'; $theme = 'Silver'; } ?>