[thelist] PHP multiple style switcher

Dan Parry dan at virtuawebtech.co.uk
Sat Nov 24 06:59:39 CST 2007


> > <?php> switch ($_GET['style']) {> case 'hicontrast':> ?>> <link
> rel="stylesheet" type="text/css" media="screen" href="hiC.css" />> <!--
> [if lte IE 6]>> <link href="css/hiCIE6.css" rel="stylesheet"
> type="text/css" > media="screen" />> <![endif]-->
> Well I get parss error for your code. I changed it to
> 
> <?phpswitch ($_GET['style'])
> {    case 'hicontrast':
> <link rel=\"stylesheet\" type=\"text/css\" media=\"screen\"
> href=\"hiC.css\" />
> <!--[if lte IE 6]><link href=\"css/hiCIE6.css\" rel=\"stylesheet\"
> type=\"text/css\" media=\"screen\" /><![endif]-->  }?>
> 
> but parse error exist.

This should work:

<?php 
   switch ($_GET['style'])	{    
   case 'hicontrast':
      echo "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\"
href=\"hiC.css\" />
           <!--[if lte IE 6]><link href=\"css/hiCIE6.css\"
rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />
	     <![endif]-->";
      
      break;
 }
 ?>
 
> Actually I got problem understanding the case. Could you
> explain it please?

Switch is explained by the PHP manual here:

http://uk2.php.net/manual/en/control-structures.switch.php

HTH

Dan

> regards
> davoud
> 
> _________________________________________________________________
> Are you ready for Windows Live Messenger Beta 8.5 ? Get the latest for
> free today!
> http://entertainment.sympatico.msn.ca/WindowsLiveMessenger
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.16.5/1149 - Release Date:
> 24/11/2007 10:06
> 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.5/1149 - Release Date: 24/11/2007
10:06
 




More information about the thelist mailing list