1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <?php
$color='white';
setcookie('couleur',$color,time()+365*24*3600);
$couleur=$_COOKIE['couleur'];
if($couleur==null){$couleur="white";}
import_request_variables("G","recu_");
if(isset($recu_r))
{
if($recu_r=="bleu"){$color='lightblue';}
else if($recu_r=="jaune"){$color='yellow';}
else if($recu_r=="vert"){$color='lightgreen';}
}
echo '<html>
<title>Cookie</title>
<body bgcolor='.$color.'>
<h2>Cookie</h2>
<form method="get" action="cookie.php">
choisissez une nouvelle couleur de fond :<br><br>
<input type="radio" name="r" value="bleu">bleu
<input type="radio" name="r" value="jaune">jaune
<input type="radio" name="r" value="vert">vert
<input type="submit" name="changer" value="changer"><br><br>
<a href="cookie2.php">Page 2<br>
</body>
</html>';
?> |
Partager