Ciao sapreste dirmi dove è l' errore???
Codice PHP:
<?php
if ($testo == "")
{
echo "Errore: Il campo testo è obbligatorio.";
echo "<META HTTP-EQUIV=REFRESH CONTENT='5; URL=index.php?id=$id'>";
}
else
{
$nome = addslashes(stripslashes($nome));
$mail = addslashes(stripslashes($mail));
$testo = addslashes(stripslashes($testo));
$nome = str_replace("<", "<", $nome);
$nome = str_replace(">", ">", $nome);
$testo = str_replace("<", "<", $testo);
$testo = str_replace(">", ">", $testo);
$mail = str_replace("<", "<", $mail);
$mail = str_replace(">", ">", $mail);
include("../../config.inc.php");
$query = "INSERT INTO news_commenti ('testo', 'data', 'utente', 'mail', 'id_news')
VALUES ('$testo', NOW(), '$nome', '$mail', '$id')";
if (mysql_query($query, $db)){
echo "L'annuncio è stato inserito correttamente";}
else{
echo "Erorre durante l'inserimento<META HTTP-EQUIV=REFRESH CONTENT='5; URL=forminserisci.php'>";
}
mysql_close($db);
}
?>