Faire passer deux variables par un textearea

Résolu/Fermé
Maskk Messages postés 89 Date d'inscription mercredi 1 juillet 2009 Statut Membre Dernière intervention 23 décembre 2010 - 6 sept. 2010 à 11:03
Maskk Messages postés 89 Date d'inscription mercredi 1 juillet 2009 Statut Membre Dernière intervention 23 décembre 2010 - 6 sept. 2010 à 12:24
Bonjour,
je me trouve confronté a un probleme je fais un formulaire pour les demandes informatiques...je voudrais pouvoir rajouter un commentaire , en tenant compte de l'id de la demande... mon probleme :
quand je fais un submit j'arrive a inserer un commentaire $com_info , que si je precise l'id en brut (update incident set commentaire = '$cominfo' where id=198) il n'arrive pas a me prendre ma variable $id=$_get['id']
en revanche quand je fais directement par un lien :
if ($action=="info") //envoi un commentaire du service info
{
$id=$_GET['id'];
$com_info=$_GET['com_info'];//c'est une insert d'un textarea (champ de texte)
$modification=odbc_do($connexion,"UPDATE incident SET commentaire='$com_info' where id=$id");

if ($resultat==1)
{
die("<br><font color='red'>Erreur execution requete</font><br>".odbc_error());
}
else echo "<p><br><font color=#F9B327>ok</font><br></p>";

}
il va me prendre $id ... mais pas mon textarea ^^ ...

Je vous link mon code html :

<form action="http://172.16.1.105/DI/modifier_demandes.php?id=$id" id="com1" method="GET">
<table width="351px" border="1" top="10px">
<tr>
<td height="61" align="center" valign="middle" bgcolor="#c0c0c0">Commentaire de l'informaticien</td>
<td align="left" valign="middle" bgcolor="#E3E3E3">
<textarea name="com_info" id="com_info" cols="25" rows="4"></textarea>
<input type="submit" name="com11" id="com11" value="envoyer")/>
</td>
</tr>
</table>
</form>

Je suis bien coincé sur ce probleme , j'espere que quelqu'un pourra m'aider... merci d'avance


A voir également:

1 réponse

Maskk Messages postés 89 Date d'inscription mercredi 1 juillet 2009 Statut Membre Dernière intervention 23 décembre 2010 2
6 sept. 2010 à 12:24
J'ai trouvé ...
if (isset($_POST['envoi_commentaire'])) //envoi un commentaire du service info
{
$id=$_POST['id'];
$identifier=$_POST['ident'];
$com_info=$_POST['com_info'];//c'est une insert d'un textarea (champ de texte)
$modification=odbc_do($connexion,"UPDATE incident SET commentaire='$com_info' where id=$identifier");

<form action="<?php echo($_SERVER['PHP_SELF']); ?>" id="envoi_commentaire" method="POST">
<table width="351px" border="1" top="10px">
<tr>
<td height="61" align="center" valign="middle" bgcolor="#c0c0c0">Commentaire de l'informaticien</td>
<td align="left" valign="middle" bgcolor="#E3E3E3">
<textarea name="com_info" id="com_info" cols="25" rows="4"></textarea>
<input type="hidden" name="ident" value="<?php echo $id ?>">
<input type="submit" name="envoi_commentaire" id="envoi_commentaire" value="envoyer")/>
</td>
</tr>
</table>
</form>
0