par
Cyrano » 09 déc. 2006, 20:41
Oui : la protection de ton apostrophe est valable pour PHP mais ne l'est plus pour MySQL : donc, il faut échapper certains échappements :
$BoxVal = '<br>Objet disponible à l\\\'échange ou à la vente.Pour plus infos <a href="mailto:[email protected]">Contactez-moi</a>.';
$insertLienimgs = "INSERT INTO tcolllego (IMLego,PIMLego,TITIMlego, BOXl) VALUES ('". $_FILES['fichier_choisi']['name']."','". $_FILES['fichier_choisi2']['name']."' ,'$TitreImagLego','". $BoxVal ."')";
Autre méthode possible :
$BoxVal = '<br>Objet disponible à l\'échange ou à la vente.Pour plus infos <a href="mailto:[email protected]">Contactez-moi</a>.';
$insertLienimgs = "INSERT INTO tcolllego (IMLego,PIMLego,TITIMlego, BOXl) ".
"VALUES ('". $_FILES['fichier_choisi']['name']."','". $_FILES['fichier_choisi2']['name']."' ,'$TitreImagLego','". mysql_real_escape_string($BoxVal) ."')";
Oui : la protection de ton apostrophe est valable pour PHP mais ne l'est plus pour MySQL : donc, il faut échapper certains échappements :
[php]$BoxVal = '<br>Objet disponible à l\\\'échange ou à la vente.Pour plus infos <a href="mailto:
[email protected]">Contactez-moi</a>.';
$insertLienimgs = "INSERT INTO tcolllego (IMLego,PIMLego,TITIMlego, BOXl) VALUES ('". $_FILES['fichier_choisi']['name']."','". $_FILES['fichier_choisi2']['name']."' ,'$TitreImagLego','". $BoxVal ."')";[/php]
Autre méthode possible :
[php]$BoxVal = '<br>Objet disponible à l\'échange ou à la vente.Pour plus infos <a href="mailto:
[email protected]">Contactez-moi</a>.';
$insertLienimgs = "INSERT INTO tcolllego (IMLego,PIMLego,TITIMlego, BOXl) ".
"VALUES ('". $_FILES['fichier_choisi']['name']."','". $_FILES['fichier_choisi2']['name']."' ,'$TitreImagLego','". mysql_real_escape_string($BoxVal) ."')";[/php]