ciao, sto facendo il debug di una parte di codice dopo questo errore:
Parse error: syntax error, unexpected ';' in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\prova\capitolo13\transact-article.php on line 102
ma non riesco a saltarci fuori, mi pare vada tutto bene.
la parte di codice interessata è questa:
case 'Submit Comment':
if (isset($_POST['article'])
and $_POST['article']
and isset($_POST['comment'])
and $_POST['comment'])
(
$sql = "INSERT INTO cms_comments " .
"(article_id,comment_date,comment_user,comment) " .
"VALUES (" . $_POST['article'] . ", '" .
date("Y-m-d H:i:s", time()) .
"'," . $_SESSION['user_id'] .
",'" . $_POST['comment'] . "')";
mysql_query($sql, $conn)
or die('Could add comment; ' . mysql_error());
}
redirect('viewarticle.php?article=' . $_POST['article']);
break;
nello specifico la riga 102 è questa:
",'" . $_POST['comment'] . "')";
grazie