hae guys am working on a discusion forum and i have some few errors how can i get lid of them this are the erors
Notice: Use of undefined constant topic_owner - assumed 'topic_owner' in C:\wamp\www\disc\do_addtopic.php on line 12
Notice: Use of undefined constant topic_title - assumed 'topic_title' in C:\wamp\www\disc\do_addtopic.php on line 12
Notice: Use of undefined constant post_text - assumed 'post_text' in C:\wamp\www\disc\do_addtopic.php on line 14
Notice: Undefined variable: topic_title in C:\wamp\www\disc\do_addtopic.php on line 47
the following are the codes
<?php
//check for required fields from the form
if ((!$_POST[topic_owner]) || (!$_POST[topic_title])
|| (!$_POST[post_text])) {
header("Location: addtopic.html");
exit;
}
//connect to server and select database
$conn = mysql_connect("localhost","root","")
or die(mysql_error());
mysql_select_db("forum",$conn) or die(mysql_error());
//create and issue the first query
$add_topic = "insert into forum_topics values ('', '$_POST[topic_title]',
now(), '$_POST[topic_owner]')";
mysql_query($add_topic,$conn) or die(mysql_error());
//get the id of the last query
$topic_id = mysql_insert_id();
//create and issue the second query
$add_post = "insert into forum_posts values ('', '$topic_id',
'$_POST[post_text]', now(), '$_POST[topic_owner]')";
mysql_query($add_post,$conn) or die(mysql_error());
//create nice message for user
$msg = "<P>The <strong>$topic_title</strong> topic has been created.</p>";
?>
<html>
<head>
<title>New Topic Added</title>
</head>
<body>
<h1>New Topic Added</h1>
<?php echo $msg; ?>
</body>
</html>