sk8agrrl wrote in php

I am trying to use a stylesheet switcher as discussed at A List Apart PHP Switcher but i cant get it to work.

I wondered if anyone would mind having a look and seeing if they can work out whats wrong.


‹ ? php
session_start();
? >
‹ ? php
if(isset($_GET['css'])){
switch ($_GET['css']) {
case 'mhwell2':
$stylesheet = '<link href="mhwell2.css" type="text/css" rel="stylesheet"&rsaquo;'; $_SESSION['csschanger']=$stylesheet; break; default: $stylesheet = '&lsaquo;link href="mhwell1.css" type="text/css" rel="stylesheet"&rsaquo;'; $_SESSION['csschanger']=$stylesheet; } } ? &rsaquo; In the header of the php/xhtml file i have: &lsaquo;? php echo ($_SESSION['csschanger'])? $_SESSION['csschanger']: '&lsaquo;link href="mhwell1.css" type="text/css" rel="stylesheet"&rsaquo;' ;?&rsaquo; and i use links to change the style sheet with the following code: Select &lsaquo;A href=" &lsaquo;?php echo $_SERVER['PHP_SELF']; ?>?css=mhwell2"&rsaquo;[leaves]&lsaquo;/a&rsaquo; or &lsaquo;A href="&lsaquo;?php echo $_SERVER['PHP_SELF']; ?>?css=default"&rsaquo;[sunflower]&lsaquo;/a&rsaquo; I really dont know php at all which is why i've borrowed a script so please dont baffle me with technospeak. The reason I want to use php rather than javascript is because of accessibility and backwards compatibility.