Style Switching
Date: 09/09/07
(PHP Community) Keywords: php, css, html
Hello, I have a small problem with understanding how the this style switcher doesn't work with more than two css layouts.
It is simple:
Before Html:
< ?php
$thestyle = $_GET['set'];
if ($thestyle == "style1")
{
$thestyle = "style2";
}
else
{
$thestyle = "style1";
}
? >
In the head:
< link rel="stylesheet" type="text/css" media="screen" href="< ?php echo($thestyle);? >.css" >
In the html:
< form name="jump" >
< select name="menu" style="font-family:Verdana, Arial, Helvetica, sans-serif;color:#333333;background-color:#FFFFFF;text-decoration:none;font-size:8pt; width:150px;" >
< option value="index.php?set=style1">gray< /option >
< option value="index.php?set=style2">blue< /option >
< /select >
< input type="button" onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" class="sebutton" value="GO" >
< /form >
If I try to add a third layout, it causes an error. What am I doing wrong? Appreciative of any help.
Forget what I said. Still need help.
Source: http://community.livejournal.com/php/584674.html