Download
<html>
<head>
</head>
<body>
<?php
$fruits = $_GET["fruits"];
if (!empty($fruits)){
echo "Les fruits séléctionnés sont: <strong>";
foreach($fruits as $elem){
echo ''.htmlentities($elem);
}
echo "</strong>.";
}
else {
echo ('
<form action="'. htmlentities($_SERVER["PHP_SELF"]).'" method="GET">
<fieldset>
<label>
Orange
<input type="checkbox" name="fruits[]" value="Orange" />
</label>
<label>
Banane
<input type="checkbox" name="fruits[]" value="Banane" />
</label>
<label>
Pomme
<input type="checkbox" name="fruits[]" value="Pomm" checked="checked" />
</label>
</fieldset>
<input type="submit" value="Envoyer" />
</form>
');
}
?>
</body>
</html> |
<html>
<head>
</head>
<body>
<?php
$fruits = $_GET["fruits"];
if (!empty($fruits)){
echo "Les fruits séléctionnés sont: <strong>";
foreach($fruits as $elem){
echo ''.htmlentities($elem);
}
echo "</strong>.";
}
else {
echo ('
<form action="'. htmlentities($_SERVER["PHP_SELF"]).'" method="GET">
<fieldset>
<label>
Orange
<input type="checkbox" name="fruits[]" value="Orange" />
</label>
<label>
Banane
<input type="checkbox" name="fruits[]" value="Banane" />
</label>
<label>
Pomme
<input type="checkbox" name="fruits[]" value="Pomm" checked="checked" />
</label>
</fieldset>
<input type="submit" value="Envoyer" />
</form>
');
}
?>
</body>
</html>