Having different CSS allows you to create different appearances for the same website. Using PHP you can let your users choose their preferred style, by offering multiple style options and setting a cookie to store the user's preference.
<link rel="stylesheet" type="text/css" href="<?php echo (!$style)?'normal':$style ?>.css" />
This code is placed on all your pages to point to the appropriate stylesheet
. Unlike a normal stylesheets, we are using <?php echo (!$style)?'mainstyles':$style ?>
instead of the stylesheet name. What this code says is: if no style is set in the cookies, use normal.css, but if a style is set, use stylename
.css. The style name is stored as $style.