<?php if(isset($_GET['bg'])){ $bg=(int)$_GET['bg']; }else{ //PAS OBLIGATOIRE $bg="white"; } switch ($bg) { case "1": $bg="green"; $titre="VERT"; break; case "2": $bg="red"; $titre="ROUGE"; break; case "3": $bg="blue"; $titre="BLUE"; break; default: $bg="white"; $titre="BLANC"; } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Document sans titre</title> </head> ;"> <?php echo $titre; ?> [<?php echo ">green] [<?php echo ">red] [<?php echo ">blue] </html>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionswitch ($bg)
switch ($_GET['bg'])Cela devrait le faire !