Alright, so create a file, dunno, setstyle.php or something.. it will set up a cookie.
<OPTION value="green">Style1</OPTION>
<OPTION value="pink">Style2</OPTION>
set those options to whatever you want, add some what ever..
<?php
$action = isset($_GET['action']);if (!$action) {
$action = "";
}
else {
$action = $_GET['action'];
}
if (!$action) {
?>
<FORM action="<?php print ($PHP_SELF); ?>?action=setstyle" method="post">
<P>
<SELECT name="styledrop">
<OPTION value="green">Style1</OPTION>
<OPTION value="pink">Style2</OPTION>
</SELECT>
<INPUT type="submit" value="Send">
</P>
</FORM>
<?php
}if ($action) {
$style = $_GET['styledrop'];
}if ($action == 'setstyle') {
$now = time();
setcookie(style, $now + 31536000, $style); //expires in a year..
echo 'Thank you, your design has been chosen!';
}if ($action && $action != 'setstyle') {
echo 'Invalid Action!';
}
?>
Then, in header.php:
<?php
//Default Style:
if (!$_COOKIE["style"]) {
$styletest = "black";
}
//If cookie is set, get information:
if ($_COOKIE["style"]) {
$styletest = $_COOKIE["style"];
}
?>
then well.. <style bla bla
<?php echo $styletest.'.css'; ?>
</style>
Now, it should work, haven't tested the script heavily though it should work. You might need to do a little modifications though.