I am having a little problem with my php page I have a simple area to icert data - only it does not incert the data. I have not encountered this before. I cannot see anything wrong with it but, maybe someone else can. connection to the database is already made at this point at the top of my page. It does connect and the date is entered but nothing else?
Here is the code:
<?php
if (isset($_REQUEST['Submit']))
{
$date = date("Y-m-d");
$sql = "INSERT INTO ads(heading, body, date, author_name, author_email, link) VALUES('$heading', '$body', '$date', '$author_name', '$author_email', '$link')";
if($result = mysql_query($sql ,$db))
{
echo "Thank you, Your information has been entered into our database";
}
else
{
echo "ERROR: ".mysql_error();
}
}
else
{
?>
<p><h3>Enter your ad into the database</h3>
<form method="post" action="test4.php">
Name: <input type="text" size="20" name="author_name"><p>
Email: <input type="text" size="20" name="author_email"><p>
Heading: <input type="text" size="20" name="heading"><p>
Description:<br>
<textarea cols=40 rows=10 name="body" wrap="virtual">
</textarea><p>
Full Link: <input type="text" size="50" name="link"><p>
<input type="submit" name="Submit" value="Submit Ad!">
</form>
<?php
}
?>
thanks for everyone's help!