[thelist] style switcher in php?

noah noah at tookish.net
Sat Oct 26 12:19:01 CDT 2002


At 10:37 AM 26/10/2002, Merlene Paynter Blacha wrote:
>I'm not trying to protect the "Caramilk Secret" so for me this works
>just fine. No user ids or passwords to deal with.

Maybe I'm missing something here, but if you're going to predefine style
sheets, why not just use the variable "$style", make it a number, and use:

switch ($_GET["style"]) {
     case 0:
         $stylesheet = "yabba";
         break;
     case 1:
         $stylesheet = "dabba";
         break;
     default:
         $stylesheet = "doo";
}

<link href="<?=$stylesheet?>.css" type="text/css">

Then it doesn't matter what people try to force "$style" to be.

Cheers,
Noah




More information about the thelist mailing list