J'aimerais savoir cmt remplir ma seconde liste deroulante (act) en fonction de la premiere (coffr). Voici mon code:
$liste_coffret="SELECT id,nom_fr from produits where type=0 and parent_id=0";
$q=mysql_query($liste_coffret);
$nom_fr=stripslashes($row["nom_fr"]);
?>
<!-- Coffrets -->
<h1>Veuillez selectionner un coffret</h1>
<form name="form" action="<?php '.$PHP_SELF.' ?>" method="POST">
<select name="coffr" size="1">
<?php while ($row=mysql_fetch_array($q)){
echo '<option value="'.$row["id"].'">'.$nom_fr.'</option>';
} ?>
</select>
<?php
$rappro="SELECT id from produits where nom_fr LIKE '".$_POST['select']."%'";
$rap=mysql_query($rappro) or die ("Erreur :" .mysql_error());
$liste_acti="SELECT * from produits where parent_id='".$rap."'";
$q1=mysql_query($liste_acti) or die ("Erreur :" .mysql_error());
$nom=stripslashes($row1["nom_fr"]);
?>
<!-- Activités -->
<h1>Veuillez choisir une/des activité(s)</h1>
<ul>
<li>Dans une liste</li><br /><br />
<select size="1" name="act">
<?php while ($row1=mysql_fetch_array($q1)){
echo '<option value="'.$row1["id"].'">'.$nom.'</option>';
?>
</select>
<br /><br />