The first part isn't PHP, it's a server config - but you can forget that part anyway - given this,
So css1.css would have one image and set of colors associated with it; css2.css would have a different background image and set if colors associated with it... on and on and on.
This really isn't the most efficient way to do this. There are probably a couple hundred, but I'd approach it by using a single style sheet and setting different classes (with a subset of another hundred or so approaches. :-P ). One example,
#header { background-position: top left; background-repeat: no repeat; }
body.theme1 #header { background-image: url(/images/theme-1-header.jpg); }
body.theme2 #header { background-image: url(/images/theme-2-header.jpg); }
body.theme3 #header { background-image: url(/images/theme-3-header.jpg); }
Statically, you'd just set a different body class on each theme.
<body class="theme1">
Dynamically, you'd modify the body class with Javascript. jQuery makes it easy, but can be done with a few lines of straight Javascript . . . .
<script type="text/javascript">
// Don't forget to include a jQuery library before this
$(function(){
$(.'change_theme a').click(function() { return swap_theme($(this).attr('data-theme')); });
});
//
function swap_theme(the_theme) {
$('body').css('class',the_theme);
return false;
}
</script>
<ul class="change_theme">
<li><a href="" data-theme="theme1">Theme 1</a></li>
<li><a href="" data-theme="theme2">Theme 2</a></li>
<li><a href="" data-theme="theme3">Theme 3</a></li>
</ul>
This is for html 5, there is no data-.... attribute in XHTML or HTML < 5, (ab)use rel instead Not working code, but this approach will work. What's happening:
$(function(){
$(.'change_theme').click(function() { return swap_theme(this.attr('data-theme')); });
});
On click of any link in a UL with the change_theme class, attach the behavior in the function wrapped in click() to the links themselves (so you don't have use do inline Javascript, onclick="return some_function()"). The return false in both the function and in the actual function swap_theme stops the link from navigating. Here we pass the clicked link's data attribute value as a parameter : swap_theme(
$(this).attr('data-theme'))
In the swap_theme function, is sets the CSS for <body> to whatever that value is. (I didn't use the jQuery function addClass so you don't have to deal with removing any class already set.)