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
|
<?php
$reponse = mysql_query("select id_module,nom_module,etat_module FROM module")
or die (mysql_error());
if(mysql_numrows($reponse)>0)
{
?>
<?php
if ($_POST["valider"]=="valider"){
$id = $_POST['id_module'];
echo "Module validé : ".$id;
}
?>
<form action='debug.php' method='post'>
<select name='id_module'>
<?php
while ($row = mysql_fetch_array($reponse))
{
$id_mod = $row['id_module'];
$nom_mod = $row['nom_module'];
$etat_mod = $row['etat_module'];
?>
<option value="<?php echo $id_mod; ?>"><?php echo $nom_mod.":".$etat_mod; ?></option>
<?php
}
?>
</select>
<input type="submit" value="valider" name="valider">
</form>
<?php } ?> |
Partager