I have a html form that calls a php script that suppose to save data to my sql. When I click post The script says that I didn't enter any data. can someone tell me what is wrong?
<form action="add.php" method ="POST">
<h5>Title</h5><br>
<input type = "text" name = "title" maxlength="100"><br>
<h5>Description</h5>
<textarea name= "des" rows="8" cols="70" maxlength="1000"></textarea><br>
<input type="reset" value="reset">
<input type = "submit" value = "post" name="add"><br>
</form>
<?php
//make our connection details
$connection = mysql_connect("localhost" , "root" )
or die ("Cannot make the connection");
//connect to sampledb with our connection details
$db = mysql_selectdb("test" , $connection)
or die ("Cannot connect to the database");
//if the text field wasnt blank enter data
if (isset($POST['add']))
{
//insert the text box data into the sample table
$query="INSERT INTO test1 (title,des,date) "
."VALUES('".$POST['title']."' , '".$POST['des']."' , '".$POST['sysdate()']."'";
$result = mysql_query($sql_query);
//display the entered link
echo "You entered the following info " . $_POST['add'];
}
//if it was blank display a message
else
{
echo ("you didnt enter any data");
}
?>
Notice that the date should be added in automatically when the user posts. I am using php 4.3.3 the globals are turned off