bon journée a tous,
dans le code php ci dessous il affiche des erreurs en exécution
Undefined index: dat
Undefined index: nbr
Aide moi SVP
code:
<form name="AFF" method="post" action="g.php">
<div align="center">
<table width="419" height="277" border="0">
<tr>
<input type="hidden" name="emplyé" value="<? echo $_GET["emp"]; ?>" />
<? $matre=$_GET["emp"];
$rr2=mysql_query("select * from employer where matricule=".$matre);
$rst2=mysql_fetch_row($rr2);
?>
<td width="106" height="47"><div align="right" class="Style3">Employé :</div></td>
<td width="27" class="bisTitle"><div align="left"><? echo $rst2[3]; ?> </div>
<div align="right"></div><div align="right"></div></td>
<td width="400" class="bisTitle"><? echo $rst2[4]; ?></td>
<input type="hidden" name="code" value="<? echo $_GET["emp"]; ?>">
<input type="hidden" name="nom" value="<? echo $_GET["nom"]; ?>">
<input type="hidden" name="pren" value="<? echo $_GET["prenom"]; ?>">
</tr>
<tr>
<td width="106" height="47">
<div align="right">
<? $r2=mysql_query("select * from fonction where code_fct=".$rst2[2]);
$rst=mysql_fetch_row($r2);
?>
<span class="Style3">fonction :</span></div></td>
<td colspan="2" class="bisTitle"><? echo $rst[1]; ?></td>
<input type="hidden" name="fct" value="<? echo $rst[1]; ?>">
</tr>
<tr>
<td width="106" height="47">
<div align="right">
<? $r2=mysql_query("select t.* from tenue t,foction_tenu ft where t.code_t=ft.code_t and ft.code_fct=".$rst2[2]);
?>
<span class="Style3"> tenue</span></div></td><td colspan="2">
<select name="tenue" class="input-text" onChange="javascript : modifcombo()"> <option value=""></option>
<?php while($t=mysql_fetch_row($r2))
{$id1=$t[0];
$lib=$t[1];
print "<option value=" . $id1;
if ($id1 == $tenue)
print " selected";
print ">" . $lib . "</option>";
?>
<?php }?>
</select> </td>
</tr>
<tr>
<td width="106" height="44" class="Style3">
<div align="right">date :</div></td>
<td colspan="2"><input type="text" name="dat" id="dateinput" class="input-text"/></td></tr>
<tr><td colspan="3">
<table width="543" height="63" border="2" cellpadding="10" align="center">
<tr bgcolor="#66CC00">
<td height="20">article</td>
<td>nbre</td>
<td>taille</td>
</tr>
<?
$ma_requ = "SELECT sf.*,c.nbre FROM sous_fam_art sf,composition c WHERE sf.code=c.code and c.code_t=".$tenue;
$reu=mysql_query($ma_requ);
?>
<?php while(@$lig=mysql_fetch_row($reu))
{
?>
<tr>
<td> <? echo $lig[2]; ?>
<input type="hidden" name="date" value="<?php echo $_POST["dat"] ?>" />
</td>
<td> <? echo $lig[3]; ?>
<input type="hidden" name="nbr" value="<? echo $lig[3]; ?>" class="input-text"/>
</td>
<td>
<? $req=mysql_query("select * from article where code=".$lig[0]." and taille =(select valeur from mensuration where matricule=".$_GET["emp"]." and cod_f=".$lig[1].")");
$rste=mysql_fetch_array($req);
?>
<? echo $rste[2]; ?></td>
<input type="hidden" name="art" value="<? echo $rste[0]; ?>" class="input-text"/>
<input type="hidden" name="tail" value="<? echo $rste[1]; ?>"/>
</tr>
<?php
$date=$_POST["dat"];
$NBRE=$_POST["nbr"];
$requetee="insert into détail values
('".$rst2[0]."','".$tenue."','".$date."','".$rste[0]."','".$NBRE."','en instance')" ;
if(mysql_query($requetee))
echo "<font color=#00FF00 ><b>Ajout effectuer</b></font>";
else
echo "<font color=#FF0000 ><b>Problème d'ajout, veuillez réessayer</b></font>";
?>
<?php } ?>
</table>
</td></tr>
<tr>
<div align="center">
<td height="47" colspan="3">
<div align="center">
<input type="submit" name="enr" value="enregistrer" />
<a href="g.php"><input type="submit" name="Submit2" value="Annuler" /></a>
</div></td>
</div>
</tr></table>
</div>
</form>