scotchsour (scotchsour) wrote in php,
scotchsour
scotchsour
php

Style Switching

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.
Subscribe

  • ¿ Que pasó con esta comunidad PHP ?

    Hay que revivir esta comunidad, PHP está mas vivo que nunca con su nueva versión PHP 8 liberada el pasado 26 de Noviembre 2020, en el año de la…

  • Hmm...

    Is this community dead or something?

  • Hello!

    I just started to use LJ, so i thought it would be nice to have some friends here. I'm into coding and programming. I recently started to practice…

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 13 comments

  • ¿ Que pasó con esta comunidad PHP ?

    Hay que revivir esta comunidad, PHP está mas vivo que nunca con su nueva versión PHP 8 liberada el pasado 26 de Noviembre 2020, en el año de la…

  • Hmm...

    Is this community dead or something?

  • Hello!

    I just started to use LJ, so i thought it would be nice to have some friends here. I'm into coding and programming. I recently started to practice…