S affiche: " Undefined index: agent_nbre"
Dias@
Messages postés
4
Statut
Membre
-
Dias@ Messages postés 4 Statut Membre -
Dias@ Messages postés 4 Statut Membre -
<table>
<tr>
<form action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="POST">
<td>Nombre d'agent en mission :</td>
<td><input type="text" name="agent_nbre"></td></form>
</tr>
<?php
$agent_num=$_POST['agent_nbre'];
for($i=0;$i<$agent_num;$i++)
{
?>
<tr>
<form action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="POST">
<td>Nombre d'agent en mission :</td>
<td><input type="text" name="agent_nbre"></td></form>
</tr>
<?php
$agent_num=$_POST['agent_nbre'];
for($i=0;$i<$agent_num;$i++)
{
?>
A voir également:
- S affiche: " Undefined index: agent_nbre"
- Le clavier de mon telephone ne s'affiche plus - Guide
- Ma clé usb ne s'affiche pas - Guide
- Faites en sorte que la cellule a1 affiche exactement ce qui est montré sur cette image. quel mot apparaît en b1 ? - Forum Excel
- Faites en sorte que la cellule a1 affiche exactement ce qui est montré sur cette image - Forum Excel
- Le fichier à télécharger est dans un format peu courant. trouvez le moyen de l’ouvrir. quel mot s’affiche ? - Forum Windows
)
PS : **** Attention ****
Merci de bien vouloir utiliser la coloration syntaxique (les balises de code) lorsque tu postes du code sur le forum.
Explications disponibles ici :
https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#balises-code
.
<code><table> <tr> <form action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?> method="POST"> <td>Nombre d'agent en mission :</td> <td><input type="text" name="agent_nbre"></td></form> </tr> <?php ; $agent_num=$_POST['agent_nbre']; for($i=0;$i<$agent_num;$i++) { ?> <form action="enregistrement.php" methode="post"> <tr> <?php $base=mysql_connect('localhost','root', '' ); mysql_select_db('mamission',$base); $sql = 'SELECT Num_Mission FROM mission order by Num_Mission Asc'; $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); while($data = mysql_fetch_array($req)) { $num= $data['Num_Mission']; } mysql_close(); ?> <td width="169" height="28">Numero de mission : </td> <td width="371"><input type="text" name="numero" size="30" value="<?php echo $num=$num+1; ?>" > </td> <?php ?> </tr> <tr> <td heigt=29>Matricule d'agent : </td> <?php $base=mysql_connect('localhost','root', '' ); mysql_select_db('mamission',$base); $sql = 'SELECT Matricule_Agent FROM agent'; $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); ?> <td> <select name="Matricule_Agent" > <?php while($data = mysql_fetch_array($req)) { ?> <option value="<?php echo $data['Matricule_Agent']?>"><?php echo $data['Matricule_Agent']?></option> <?php } mysql_close(); ?> </select></td> <tr> <td height="29">Nom d'agent : </td> <?php $base=mysql_connect('localhost','root', '' ); mysql_select_db('mamission',$base); $sql = 'SELECT Nom_Agent FROM agent'; $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); ?> <td> <select name="agent" > <?php while($data = mysql_fetch_array($req)) { ?> <option value="<?php echo $data['Nom_Agent']?>"><?php echo $data['Nom_Agent']?></option> <?php } mysql_close(); ?> </select> </td> </tr> </tr> <tr> <td height=29>Service d'agent: </td> <?php $base=mysql_connect('localhost','root', '' ); mysql_select_db('mamission',$base); $sql = 'SELECT Service FROM vehicule'; $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); ?> <td> <select name="service"> <?php while($data = mysql_fetch_array($req)) { ?> <option value="<?php echo $data['Service']?>"><?php echo $data['Service']?></option> <?php } mysql_close(); ?> </select></td> </tr> <tr> <td width="169" height="28">Télephone d'Agent : </td> <td width="371"><input type="text" name="Tel" size="30" class="formilaire"> </td> </tr> <tr> <td>______________________</td> </tr> <?php } ?> </table></code>