Sto uscendo pazzo! Mi dice che c'è un errore di sintassi...
Chi mi aiuta?
codice:
<?php
session_start ();
include("config/dbconnect.php");
$nick= $_SESSION["nick"];
if($nick)
{
// $data = date("%d.%m.%y");
$titolo = $_POST["titolo"];
$_SESSION["titolo"] = $titolo;
$testo = $_POST["testo"];
$_SESSION["testo"] = $testo;
$argomentoa = $_POST["argomentoa"];
$_SESSION["argomentoa"] = $argomentoa;
$argomentob = $_POST["argomentob"];
$_SESSION["argomentob"] = $argomentob;
$urlargomentoa = $_POST["urlargomentoa"];
$_SESSION["urlargomentoa"] = $urlargomentoa;
$urlargomentob = $_POST["urlargomentob"];
$_SESSION["urlargomentob"] = $urlargomentob;
if($titolo AND $testo)
{
$query = "insert into $table_articoli (titolo, testo,
autore, argomentoa, argomentob,
urlargomentoa, urlargomentob) values ('$titolo', '$testo', '$nick',
'$argomentoa', '$argomentob',
'$urlargomentoa', '$urlargomentob');";
$risultato = mysql_query($query,$db) or die ("Impossibile aggiungere news!".
mysql_error());
$subject = "Nuova articolo inserito!!!";
$message = "
Titolo: $subject
";
$from="staff@xxxxxxx.com";
$email="staff@xxxxxxxx.com";
mail($email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
echo "<meta http-equiv='refresh' content='2; url=articoli.php'>";
}
else echo "Devi completare i campi richiesti per inserire un articolo!!!
<meta http-equiv='refresh'
content='2; url=javascript:history.back(1)'>";
mysql_close($db);
}
else echo "Devi fare il login!!!<meta http-equiv='refresh' content='2; url=login.php'>";
?>