I have written a webpage allowing people to add there own news to a news feed.
however, when i open my browser i get this error:
Notice: Undefined index: post in C:\xampp\htdocs\CSB\csbpost.php on line 5
Here Is The PhP that allows the users news to be posted:
<?php
if ($_POST['post'])
{
$title = $_POST['title'];
$body = $_POST['body'];
if ($title&&$body)
{
echo 'Insert';
}
else
echo "Please fill out title and body<p>";
}
?>
And here is the HTML That calls for the layout:
<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>
</html>
That didnt work
however, when i open my browser i get this error:
Notice: Undefined index: post in C:\xampp\htdocs\CSB\csbpost.php on line 5
Here Is The PhP that allows the users news to be posted:
<?php
if ($_POST['post'])
{
$title = $_POST['title'];
$body = $_POST['body'];
if ($title&&$body)
{
echo 'Insert';
}
else
echo "Please fill out title and body<p>";
}
?>
And here is the HTML That calls for the layout:
<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>
</html>
That didnt work