Eléphant du PHP |
256 Messages
18 févr. 2011, 12:34
Bon ça ne fonctionne pas
En fait j'ai ceci
<form method="post" action="SendMail.php">
<p align=center><input type='text' size='100' name='Comment'>
<p align=center><input type="submit" value="Confirmer">
Dans la zone input Comment j'ai saisi [Test ' " / \] sans les []
dans SendMail.php
$Comment = $_POST["Comment"];
$Comment = mysql_real_escape_string($Comment); /* Protect from special characters */
mysql_query("INSERT INTO VTTlog (Date, Name, Choice,Comment) VALUES ('$Date','$Name','$choice1','$Comment')") or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
Sans mysql_real_escape_string la fonction mysql_query("INSERT ... se termine avec le die
Avec mysql_real_escape_string la fonction mysql_query("INSERT ... s'exécute sans erreur mais il n'y a rien dans la champ $Comment de la DB !