shinko_metsuo
09-04-2005, 12:31 AM
Not sure. It puts everything I need in the Database but it shows undefined constant in my INSERT.
<?php
if (isset($_POST['submit'])) {
// process form
$sql = "INSERT INTO content (topicname,content,name,date) VALUES ('".$_POST[topic]."','".$_POST[content]."','".$_POST[name]."','".$_POST[date]."')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<div class="post" id="1">
<h2>Welcome</h2>
<form method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
Topic name:<input type="Text" name="topic" id="topic"><br />
Message:<input type="Text" name="content" id="content"><br />
Username:<input type="Text" name="name" id="name"><br />
Date:<input type="Text" name="date" id="date"><br />
<input type="Submit" name="submit" value="Enter information">
</form>
</div>
<?php
} // end if
?>
Also a time for when the post was posted would be nice :)
Thanks advanced,
Metsuo
<?php
if (isset($_POST['submit'])) {
// process form
$sql = "INSERT INTO content (topicname,content,name,date) VALUES ('".$_POST[topic]."','".$_POST[content]."','".$_POST[name]."','".$_POST[date]."')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<div class="post" id="1">
<h2>Welcome</h2>
<form method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
Topic name:<input type="Text" name="topic" id="topic"><br />
Message:<input type="Text" name="content" id="content"><br />
Username:<input type="Text" name="name" id="name"><br />
Date:<input type="Text" name="date" id="date"><br />
<input type="Submit" name="submit" value="Enter information">
</form>
</div>
<?php
} // end if
?>
Also a time for when the post was posted would be nice :)
Thanks advanced,
Metsuo