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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<form method="post" action="http://127.0.0.1/HRA/new 5.php">
<?php
"set names 'UTF8'";
include('presentation_2.php');
include('connexion.php');
$sql_1 = "SELECT * FROM pays";
$resultat_1 = mysql_query($sql_1);
$nom_des_pays = "<p align=center><select name='menu1'></p>\n";
while ($row = mysql_fetch_array($resultat_1) ) {
$nom_des_pays .= "<option value='" . $row['id_pays'] . "'>" . $row['nom_pays'] . "</option>\n";
}
echo $nom_des_pays;
for($i = 1; $i < 5; $i++)
{
$selected = (isset(
$_POST['menu1']) and $_POST['menu1'] == $i)? 'selected="selected"':'';
echo '<option value="'.$i.'" '.$selected.'>'.$i.'</option>'
;
}
?>
</select>
</p><p align="center"><input type="submit" value="Suivant"><hr>
<?php
$sql_2 = "select * from loca where id_pays= ".$_POST['menu1']."";
$resultat_2 = mysql_query($sql_2);
$nom_des_villes = "<p align=center><select name='menu3'></p>\n";
while ($row = mysql_fetch_array($resultat_2) ) {
$nom_des_villes .= "<option value='" . $row['id_ville'] . "'>" . $row['nom_ville'] . "</option>\n";
}
echo $$nom_des_villes ;
?>
</form>
</body>
</html> |
Partager