I'm trying to create a script that works with cookies and sessions, i'm not sure if this is possible.

This is what i've got at the moment, but the session side of it doesn't seem to work. Basically I want the session to remember a chosen theme, should the user have cookies disabled.

PHP Code:


$theme "";

if empty(
$_COOKIE['themeChoice']) {
    if (isset (
$_GET['theme']) == "blue") {
$_SESSION['theme'] = 'blue';
    } elseif (isset(
$_GET['setTheme']) == "red") {
$_SESSION['theme'] = 'red';

$_SESSION['theme'] = $theme;

//checks if setTheme in address bar or cookie has been set
if (isset ($_GET['setTheme']) || isset($_COOKIE['themeChoice']) || isset($_SESSION['theme'])) {
//if either value is blue
if (($_GET['setTheme'] == "blue") || ($_COOKIE['themeChoice'] == "blue") || ($_SESSION['theme'] == 'blue')) {
//set theme variable to blue
$theme "blue";
//if either value is red
} elseif (($_GET['setTheme'] == "red") || ($_COOKIE['themeChoice'] == "red") || ($_SESSION['theme'] == 'red')) {
//set theme variable to red
$theme "red";
//if theme is already set and user has opted to change their current theme
if ($theme == "blue" && isset($_GET['changeTheme'])) {
$theme "red";
} elseif (
$theme == "red" && isset($_GET['changeTheme'])) {
$theme "blue"
//set cookie for theme for next visit
//if the variable is empty (user hasn't come from choicePage nor has a cookie set) go to choicePage
if ($theme == ""){

And here is the html...
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html class="no-js">


	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<link rel="stylesheet" type="text/css" media="all" href="css/<?php echo $theme; ?>.css" /> 

	<title>Insert title here</title>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>



	<div id="main">
		<div id="vertical"></div>
		<div id="logo">
			<img src="images/<?php echo $theme; ?>/logo.png">

	<p><a href="sessionindex.php?changeTheme">Choose a New Theme</a></p>
	<script type="text/javascript">


Any ideas? This is one of my first goes at PHP so please be nice.