Avec plaisir.
<form method=POST action="http://10.212.80.71/cdp/passage.php">
<table width='690px'>
<tr>
<th>Nom de la station : </th>
<td>
<select id='type' name= 'station'>
<option VALUE="" ></option>
<?php
$result=mysql_query("select distinct nom from STATION where secteur = 'Toulouse Sud'") or die (mysql_error());
echo "<option VALUE='Toulouse Sud' >+++ TOULOUSE SUD +++</option>";
while ($ligne= mysql_fetch_array($result))
{
echo "<option VALUE='$ligne[0]' >$ligne[0] </option>";
}
$result=mysql_query("select distinct nom from STATION where secteur = 'Toulouse Nord'") or die (mysql_error());
echo "<option VALUE='Toulouse Nord' >+++ TOULOUSE NORD +++</option>";
while ($ligne= mysql_fetch_array($result))
{
echo "<option VALUE='$ligne[0]' >$ligne[0] </option>";
}
$result=mysql_query("select distinct nom from STATION where secteur = 'Toulouse Est'") or die (mysql_error());
echo "<option VALUE='Toulouse Est' >+++ TOULOUSE EST +++</option>";
while ($ligne= mysql_fetch_array($result))
{
echo "<option VALUE='$ligne[0]' >$ligne[0] </option>";
}
?>
</select>
</td>
</tr>
<tr><td><br/></td></tr>
<tr>
<th>Noms des Personnes :</th>
<td>
<?php
$result=mysql_query("select nom1,nom2 from EQUIPE where id_equipe = '3';" ) or die (mysql_error());
while ($ligne= mysql_fetch_array($result))
{
$nom1est= split (" ",$ligne[0]);
$nom2est= split (" ",$ligne[1]);
echo "<input name=equipe type='radio' value = '3'>$nom1est[1] / $nom2est[1]";
}
?>
</td>
<td>
<?php
$result=mysql_query("select nom1,nom2 from EQUIPE where id_equipe = '2';" ) or die (mysql_error());
while ($ligne= mysql_fetch_array($result))
{
$nom1nord= split (" ",$ligne[0]);
$nom2nord= split (" ",$ligne[1]);
echo "<input name=equipe type='radio' value ='2'>$nom1nord[1] / $nom2nord[1]";
}
?>
</td>
<td>
<?php
$result=mysql_query("select nom1,nom2 from EQUIPE where id_equipe = '1';" ) or die (mysql_error());
while ($ligne= mysql_fetch_array($result))
{
$nom1sud= split (" ",$ligne[0]);
$nom2sud= split (" ",$ligne[1]);
echo "<input name=equipe type='radio' value = '1'>$nom1sud[1] / $nom2sud[1]";
}
?>
</td>
</tr>
<tr><td><br/></td></tr>
<tr>
<th> Ou : </th>
<td>
<select id='type' name= 'nom1'>
<option VALUE="" ></option>
<?php
$result=mysql_query("select nom from Nom where Nom.nom not like '%Toulouse%' ");
while ($ligne= mysql_fetch_array($result))
{
echo "<option VALUE='$ligne[0]' >$ligne[0]</option>";
}
?>
</select>
</td>
<td>
<select id='type' name= 'nom2'>
<option VALUE="" ></option>
<?php
$result=mysql_query("select nom from Nom where Nom.nom not like '%Toulouse%'");
while ($ligne= mysql_fetch_array($result))
{
echo "<option VALUE='$ligne[0]' >$ligne[0]</option>";
}
?>
</select>
</td>
</tr>
<tr><td><br/></td></tr>
<tr>
<th> Veuillez entrez une date : </th>
<td>
<input onclick="ds_sh(this);" name="date" readonly="readonly" style="cursor: text" /><br />
</td>
</tr>
<tr><td><br/></td></tr>
</table>
<input type= "button" value="Nouveau Dossier" ></p>
</form>
et par la suite je fais sa
<?php
If ($_POST['station']!= NULL)
{
If (($_POST['date']) != NULL)
{
$date = mysql_real_escape_string(htmlspecialchars($_POST['date']));
}
If ($_POST['equipe'] !=NULL)
{
$idEquipeSelection = mysql_real_escape_string(htmlspecialchars($_POST['equipe']));
$station = mysql_real_escape_string(htmlspecialchars($_POST['station']));
$result=mysql_query("select id_station from STATION where Nom = '$station'");
while ($ligne= mysql_fetch_array($result))
{
$id_station = $ligne[0];
}
}
If (($_POST['nom1']!= NULL) and ($_POST['nom2']!=NULL))
{
$station = mysql_real_escape_string(htmlspecialchars($_POST['station']));
$result=mysql_query("select id_station from STATION where Nom = '$station'");
while ($ligne= mysql_fetch_array($result))
{
$id_station = $ligne[0];
}
$nom1 = mysql_real_escape_string(htmlspecialchars($_POST['nom1']));
$nom2 = mysql_real_escape_string(htmlspecialchars($_POST['nom2']));
// On peut enfin enregistrer
mysql_query("INSERT INTO EQUIPE (nom1,nom2) VALUES('$nom1','$nom2')") or die (mysql_error());
$result = mysql_query("SELECT id_equipe FROM EQUIPE ORDER BY id_equipe DESC LIMIT 0,1");
$row = mysql_fetch_array($result) or die (mysql_error());
$dernierID = $row["id_equipe"];
}
mysql_query("INSERT INTO DOSSIER (id_station,id_equipe,date) VALUES('$id_station','$dernierID','$date')") ;
}else{
echo "<b> Veuillez remplir tous les champs svp.</b>";}