Bonjour, aujourd'hui je vais etre enervant car je vais mettre beaucoup dans ce message, je suis completement paumé !!!

Mon problème est que chaque fois que j'actualise la page, il me créée un enregistrement (vide) dans la table commentaires.
Mon second problème est que je n'arrive pas à enregistrer les informations que je souhaite, à savoir le champ action et le champ commentaire (par le bias de 2 textearea).
Je dois travailler sur le code de la personne que je remplace, je ne comprends pas tout en plus on m'oblige a reprendre son travail, c'est pas évident du tout
J'espere sincerement que j'aurais une réponse car je ne sais plus quoi faire...
<? include "_connexion.php" ?>
<?
$datedujour=date("d-m-Y");
?>
<?
$numinc=$_GET['numinc'];
if($numinc==""){$numinc=$_POST[numinc];}
if($numinc==""){$numinc=$_SESSION['numinc'] ;}
$query = "SELECT * FROM incidents WHERE numinc LIKE '$numinc'";
$result = mysql_query($query) or die ("<p align=center class=text>Lecture des demandes impossible (incidents)</p>");
$nb_result = mysql_num_rows($result);
while ($row = mysql_fetch_array($result))
{ $cle= $row['cle'];
$login_admin= $row['login_admin'];
$id_utilisateur= $row['id_utilisateur'];
$numinc= $row['numinc'];
$date_creation= $row['date_creation'];
$heure_creation= $row['heure_creation'];
$nom_utilisateur= $row['nom_utilisateur'];
$media= $row['media'];
$statut= $row['statut'];
$date_statut= $row['date_statut'];
$categorie= $row['categorie'];
$type= $row['type'];
$resume= $row['resume'];
$non_justifie= $row['non_justifie'];
$origine= $row['origine'];
$verrou= $row['verrou'];
$date_verrou= $row['date_verrou'];
$niveau_incident= $row['niveau_incident'];
$nom_admin= $row['nom_admin'];
$intervenant= $row['intervenant'];
$societe= $row['societe'];
// c'est ici que ça se passe :
}
?>
<?
$numinc=$_GET['numinc'];
if($numinc==""){$numinc=$_POST[numinc];}
$query2 = "SELECT * FROM commentaires WHERE numinc LIKE '$numinc'";
$result2 = mysql_query($query2) or die ("<p align=center class=text>Lecture des demandes impossible(historiques)</p>");
$nb_result2 = mysql_num_rows($result2);
while ($row2 = mysql_fetch_array($result2))
{ $id_commentaire=$row2['id_commentaire'];
$nom_admin=$row2['nom_admin'];
$date=$row2['date'];
$heure=$row2['heure'];
$commentaire=$row2['commentaire'];
$action=$row2['action'];
$numinc=$row2['numinc'];
}
?>
<?
if(isset($_POST['envoi'])) $envoi=$_POST['envoi'];
else $envoi="";
if(isset($_POST['envoi2'])) $envoi2=$_POST['envoi2'];
else $envoi2="";?>
<? if($envoi==1 ){
$intervenant = $_POST['intervenant'];
$statut = $_POST['statut'];
$query10 = "UPDATE incidents SET intervenant='$intervenant'";
$query10 .= " WHERE numinc='$numinc' ";
$result10 = mysql_query($query10);
$query11 = "UPDATE incidents SET statut='$statut'";
$query11 .= " WHERE numinc='$num' ";
$result11 = mysql_query($query11);
}
$sql = "INSERT INTO commentaires(nom_admin,date,heure,commentaire,action,numinc) VALUES('$nom_admin','$date','$heure','$commentaire','$action','$numinc')";
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
[ Lien ]">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Welcome to ASSIST-LINE ®</title>
<link href="CSS/3col_leftNav.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Style20 {color: #009900}
.Bleu {color: #006699}
.Style22 {color: #009900; font-weight: bold; }
.Style23 {
font-size: 11px;
font-weight: bold;
}
.Style24 {font-size: 12px}
.Style26 {font-size: 12px; font-weight: bold; }
.Style27 {
font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FF0000;
}
body {
background-image: url(Images/Bkgrd.gif);
bgproperties:fixed;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function SubAct()
{
document.f.submit();
document.fAct.submit();
}
function SubFor()
{
document.f.submit();
document.fForum.submit();
}
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body bgproperties="fixed" onload="window.setTimeout ('history.go (0)',100000)">
<table width="540" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="10" align="left" valign="top"><img src="Images/space.gif" width="10" height="1"></td>
<td width="530" align="left" valign="top"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><img src="Images/space.gif" width="1" height="10"></td>
</tr>
<tr>
<td><table width="100%" border="0" align="left" cellpadding="0" cellspacing="1">
<tr class="Style18">
<td width="50%" class="Style2"><strong>Incident </strong>(<strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><? echo $statut ?></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong>)</td>
<td width="50%" align="right"><span class="Style23">Crée par <strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><? echo $nom_admin ?></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></span> </td>
</tr>
<tr class="Style18">
<td colspan="2"> </td>
</tr>
<tr class="Style18">
<td colspan="2" align="left" valign="top"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" id="TblLog">
<tr>
<td><form action="" name="f" method="post">
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="2">
<tr>
<td><table width="100%" border="0" cellspacing="3">
<tr>
<td width="25%"><strong>Numéro incident :</strong></td>
<td><span class="Style22"> <? echo $numinc ?></span> pris en charge par <span class="Style27"><? echo $intervenant ?></td>
</tr>
<tr>
<td width="25%"><strong>Utilisateur concerné :</strong></td>
<td><span class="Bleu"><a href="popDtlUser.php?"></a><strong><? echo $nom_utilisateur ?></strong></td>
</tr>
<tr>
<td><strong>Date de creation :</strong></td>
<td><span class="Style20"> <? echo $date_creation ?> à<? echo $heure_creation ?> par <? echo $nom_admin ?></td>
</tr>
<tr>
<td><strong>Origine :</strong></td>
<td><span class="Style20"><? echo $origine ?></td>
</tr>
<tr>
<td><strong>Media d'arrivée :</strong></td>
<td><span class="Style20"><? echo $media ?></td>
</tr>
<tr>
<td><strong>Justifié :</strong></td>
<td><? echo $non_justifie ?></td>
</tr>
<tr>
<td width="25%"><strong>Categorie :</strong></td>
<td><span class="Style20"><? echo $categorie ?></td>
</tr>
<tr>
<td><strong>Type :</strong></td>
<td><? echo $type ?></td>
</tr>
<tr>
<td><strong>Niveau : </td>
<td width="68%"><img src="Images/<?=$niveau_incident?>.gif"> Niveau <? echo $niveau_incident ?></td>
</tr>
<tr>
<td><strong>Statut :</strong></td>
<td><span class="Style22"><? echo $statut ?></td>
</tr>
<tr>
<td><strong>Intervenant : </strong></td>
<td><select name="select" onChange="document.f.intervenant.value=document.f.select.value">
<option selected > </option>
<option value="JV">J VILLETTE</option>
<option value="CL">C LOUMI</option>
<option value="CH">C HURE</option>
<option value="FDC">F DUCHATEAU</option>
<option value="HL">HOTLINE</option>
<option value="TBDC">T BOUQUET DES CHAUX</option>
<option value="CP">C PEREIRA</option>
<option value="FP">F PERAUD</option>
</select>
<input name="DateStatut" type="hidden" id="DateStatut" value=""> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><strong>Détail de l'incident : </strong></td>
<td><? echo $resume ?></td>
</tr>
<tr>
<td> </td>
<td><input name="intervenant" type="hidden" id="intervenant" value="">
<input name="NumInc" type="hidden" value=""></td>
</tr>
<tr>
<td colspan="2"><span class="Style24"><strong> <a href="updateincdent.php">Modifier l'incident</a></strong> / <span class="Style24"><strong><a href="charge.php">Prendre en charge</a></strong> </td>
</tr>
<tr>
<td colspan="2"><span class="Style24"><strong><a href="eraseInc.php?numinc=" target="_self">Supprimer l'incident</a></strong></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="2">
<tr>
<td colspan="2"><strong>Historique des modifications</strong></td>
</tr>
<tr>
<td colspan="2" valign="top"><div id="LyrHist" style="position:absolute; left:Auto; top:auto; width:510px; height:55px; z-index:3; visibility: visible; overflow: auto;">
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Modifié le <strong></strong> / par <strong></strong> (,Niveau, <strong></strong>)</td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td colspan="2" valign="top"><img src="Images/space.gif" width="1" height="65"></td>
</tr>
</table></td>
</tr>
</table>
<input type="hidden" name="MM_update" value="f">
<input type="hidden" name="MM_recordId" value="">
</form></td>
</tr>
</table></td>
</tr>
<tr class="Style18">
<td width="50%"> </td>
<td width="50%"> </td>
</tr>
<tr class="Style18">
<td width="50%"><strong>ACTIONS</strong></td>
<td width="50%"> </td>
</tr>
<tr class="Style18">
<td align="left" colspan="2">
<div id="LyrAct" style="position:absolute; left:Auto; top:auto; width:530px; height:80px; z-index:1; overflow: auto; visibility: visible;">
<table width="500" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" id="Tbl">
<tr>
<td><table width="100%" border="0" align="left" cellpadding="0" cellspacing="1">
<tr>
<td width="35%" height="14" align="left" valign="top"> </td>
<td width="65%" rowspan="2" align="left" valign="top"></td>
</tr>
<tr>
<td width="35%" align="left" valign="top"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</div></td>
</tr>
<tr align="left" valign="top" class="Style18">
<td colspan="2"><img src="Images/space.gif" width="1" height="80"></td>
</tr>
<tr class="Style18">
<td colspan="2">Ajouter une action réalisée (entrez la description de votre action puis validez)<br><textarea name="action" cols="50" rows="2" id="textarea"></textarea></td>
</tr>
<tr class="Style18">
<td colspan="2">
<table width="100%" border="0" align="left">
<tr>
<td><input name="numinc" type="hidden" class="cellule" value="<? echo $numinc; ?>"><input type="hidden" name="envoi" value="1"> <input type="submit" value="Enregistrer" name ="ENREGISTRER" > </td>
<td>
<input type="button" name="Submit2" value="Ajouter" onClick="SubAct();">
<input name="nom_admin" type="hidden" value="">
<input type="hidden" name="date" value="" >
<input type="hidden" name="heure" value="" >
<input type="hidden" name="numinc" value="" >
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="action">
</form></td>
</tr>
<tr class="Style18">
<td colspan="2"></td>
</tr>
<tr class="Style18">
<td width="50%"><strong class="Style2">Commentaires</strong></td>
<td width="50%"> </td>
</tr>
<tr class="Style18">
<td colspan="2"><div id="LayComm" style="position:absolute; left:Auto; top:auto; width:530px; height:80px; z-index:2; overflow: auto;">
<table width="500" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><table width="90%" border="0" align="left" cellpadding="0" cellspacing="0" id="Tbl">
<tr>
<td><table width="100%" border="0" align="left" cellpadding="0" cellspacing="1">
<tr>
<td width="35%" height="14" align="left" valign="top"><strong></strong></td>
<td width="65%" rowspan="2" align="left" valign="top"></td>
</tr>
<tr>
<td width="35%" align="left" valign="top"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div></td>
</tr>
<tr align="left" valign="top" class="Style18">
<td colspan="2"><img src="Images/space.gif" width="1" height="80"></td>
</tr>
<tr class="Style18">
<td colspan="2">Ajouter un commentaire (entrez votre commentaire puis validez) </td>
</tr>
<tr align="left" valign="top" class="Style18">
<td colspan="2"><form action="" method="POST" name="fForum" id="fForum">
<table width="100%" border="0">
<tr>
<td><textarea name="commentaire" cols="50" rows="2" id="Comm"></textarea></td>
<td>
<input name="numinc" type="hidden" class="cellule" value="<? echo $numinc; ?>"><input type="hidden" name="envoi2" value="1"> <input type="submit" value="Enregistrer" name ="ENREGISTRER" >
<input type="button" name="Submit2" value="Ajouter" onClick="SubFor();">
<input name="nom_admin" type="hidden" value="">
<input type="hidden" name="DtForum" value="" >
<input type="hidden" name="HreForum" value="" >
<input type="hidden" name="numinc" value="" >
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="fForum">
</form></td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
Merci d'avance
chris tuckers, l'as de coeur