you could do like this.
Make a separate file which determines the css and call the function/script. π
</head>
<?php
require_once('./css_switcher.inc.php');
?>
<body class="<?php echo css_switch($_GET); ?>">
<div>
.. blarh blarh ..
css_switcher.inc.php:
<?php
function css_switch($var = '')
{
$class = null;
$layout = 'default'; // (default, left)
$font_size = 'default'; // (default, large)
$font_face = 'default'; // (default, trebuchet ms, georgia, arial)
if ((isset($var)) && (is_array($var))) {
switch ($var['layout']) {
case 'default':
$layout = 'default';
break;
case 'left':
$layout = 'left';
break;
default:
$layout = 'default';
break;
}
switch ($var['font-size']) {
case 'default':
$font_size = 'default';
break;
case 'large':
$font_size = 'large';
break;
default:
$font_size = 'default';
break;
}
switch ($var['font-face']) {
case 'default':
$font_face = 'default';
break;
case 'trebuchet':
$font_face = 'trebuchet';
break;
case 'georgia':
$font_face = 'georgia';
break;
case 'arial':
$font_face = 'arial';
break;
default:
$font_face = 'default';
break;
}
}
$class = $layout .' '. $font_size .' '. $font_face;
return $class;
}
?>