Can anyone tell me whats wrong with this php code? it doesnt want to insert into my database, I have xxxed out the database username password, ect so thats not the problem.
Stumped.
<?php
if ((!$_post[topic_owner]) || (!$_Post[topic_title])
|| (!$_Post[post_text])) {
header("Location: addtopic.html");
exit;
}
$conn = mysql_connect("xxxx", "xxxx", "xxxx") or die(mysql_error());
mysql_select_db("SwishForum",$conn) or die(mysql_error());
$add_topic = "insert into forum_topics values ('', '$_POST[topic_title]',
now(), '$POST[topic_owner]')";
mysql_query($add_topic,$conn) or die(mysql_error());
$topic_id = mysql_insert_id();
$add_post = "insert into forums_posts values ('', '$topic_id', '$_POST[post_text]', now(),
'$POST[topic_owner]')";
mysql_query($add_post,$conn) or die(mysql_error());
$msg = "Topic has been created";
?>
<html>
<head>
<title>Add topic</title>
</head>
<body>
<h1> New Topic Added</h1>
<?php print $msg; ?>
</body>
</html>
Thanks in advance. 🙂