ive allowed people to post onto a news feed on my website... but this damn error wont go away:
Notice: Undefined index: post in C:\xampp\htdocs\CSB\csbin.php on line 57
Here is the php i used (which calls for 'post', which is the name of a button in some html i wrote):
<?php
include_once 'csbfunctions.php';
if ($_POST['post'])
{
$title = $_POST['title'];
$body = $_POST['body'];
if ($title&&$body)
{
mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db("publications") or die(mysql_error());
$date = date("Y-m-d");
$insert = mysql_query("INSERT INTO news VALUES ('','$title','$body','$date')") or die(mysql_erorr());
}
else
echo "Please fill out title and body<p>";
}
?>
And The Html that has name's post:
<form action='csbpost.php' method='post'>
Title:<br />
<input type='text' name='title'><p>
Body:<br />
<textarea rows='6' cols='35' name='body'></textarea><p>
<input type='submit' name='post' value='post this news'>
</form>
Please Help, And Thanks For Taking The Time To Read This!
Bookmarks