Codice PHP:
<?
include("config.inc.php");
$titolo=$_REQUEST['titolo'];
$sottotitolo=$_REQUEST['sottotitolo'];
$testonews=$_REQUEST['testonews'];
$testonews_tagliato=$_REQUEST['testonews'];
if (trim($titolo) == ""):
echo "inserire titolo";
elseif (trim($sottotitolo) == ""):
echo "inserire sottotitolo";
else :
$titolo = str_replace("à", "à", $titolo);
$titolo = str_replace("è", "è", $titolo);
$titolo = str_replace("é", "é", $titolo);
$titolo = str_replace("ì", "ì", $titolo);
$titolo = str_replace("ò", "ò", $titolo);
$sottotitolo = str_replace("à", "à", $sottotitolo);
$sottotitolo = str_replace("è", "è", $sottotitolo);
$sottotitolo = str_replace("é", "é", $sottotitolo);
$sottotitolo = str_replace("ì", "ì", $sottotitolo);
$sottotitolo = str_replace("ò", "ò", $sottotitolo);
$testonews = str_replace("à", "à", $testonews);
$testonews = str_replace("è", "è", $testonews);
$testonews = str_replace("é", "é", $testonews);
$testonews = str_replace("ì", "ì", $testonews);
$testonews = str_replace("ò", "ò", $testonews);
$testonews_tagliato = str_replace("à", "à", $testonews_tagliato);
$testonews_tagliato = str_replace("è", "è", $testonews_tagliato);
$testonews_tagliato = str_replace("é", "é", $testonews_tagliato);
$testonews_tagliato = str_replace("ì", "ì", $testonews_tagliato);
$testonews_tagliato = str_replace("ò", "ò", $testonews_tagliato);
$testonews = addslashes(stripslashes($testonews));
$testonews_tagliato = addslashes(stripslashes($testonews_tagliato));
$testonews_tagliato = substr($testonews_tagliato, 0, 210);
$db = mysql_connect($db_host, $db_user, $db_password);
if ($db == FALSE)
die ("errore");
mysql_select_db($db_name, $db)
or die ("errore");
$query = "INSERT INTO news (titolo, sottotitolo, testonews, testonews_tagliato) VALUES ('$titolo', '$sottotitolo', '$testonews', '$testonews_tagliato')";
if (mysql_query($query, $db))
echo "
ok
";
else
echo "
no
$query
";
mysql_close($db);
endif; // chiude la verifica della presenza dei dati
?>
dove risiede l'errore?!?!?