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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| <?php
/* Affiche un bouton Radio
*/
?>
<html>
<head>
<title>Type d'animaux</title>
</head>
<Body>
<?php
$user="root";
$host="localhost";
$password="";
$database="anicata";
$connexion = mysqli_connect($host,$user,$password,$database)
or die ("Connexion impossible") ;
$rq = "Select distinct AnimalType from Animal order by AnimalType";
$result=mysqli_query($connexion, $rq)
Or die('Execution de la requête impossible');
echo "<div style='margin-left: .5in; margin-top: .5in'>
<p>
<p><b>Quel type d'animal ? </b>
<p>Choisissez dans la liste\n";
echo "<form action='traitement.php' method='post'>\n";
while ($ligne = mysqli_fetch_assoc($result)) {
echo $ligne["AnimalType"];
}
while ($ligne = mysqli_fetch_assoc($result));
{
extract($ligne);
echo "<input type='radio' name='choix' value='$AnimalType'>
$AnimalType\n";
echo "<br>\n";
}
echo "<p><input type='submit' value='Validez votre choix'>
</form>\n";
?>
</div>
</Body>
</html> |
Partager