I'm on chapter 12 and encountered a problem when I tried to compose an article as a administrator. The article doesn't seem to have been saved into the database.
This is the code from transact-article.php, can someone tell me what I did wrong.
if (isset($_POST['title']) && isset($_POST['body']) && isset($_SESSION['user_id']))
{ $sql = "INSERT INTO cms_articles " . " (title,body,author_id,date_submitted)" .
"VALUES ('" . $_POST['title'] . "','" . $_POST['body'] ."','" . $_SESSION['user_id'] . "',
'". date("Y-m-d H:i:s",time()) . "')";
mysql_query($sql,$conn) or die('Could not submit article; ' . mysql_error());
}
Any help would be appreciated.
Note: I found a similar topic on page 7 of this forum but the link
http://p2p.wrox.com/topic.asp?TOPIC_ID=15027 doesn't seem to work.