I have 6 things and the ID and DATE i suppose are NULL as the date is something like CURDATE() and ID is auto increasment but how do i have a form that sends the information to the database as the Spoono.com tutorial dont work.
I have 6 things and the ID and DATE i suppose are NULL as the date is something like CURDATE() and ID is auto increasment but how do i have a form that sends the information to the database as the Spoono.com tutorial dont work.
$location="localhost"; $username="your_db_username"; $password="your_db_password"; $database="database_name"; $conn = mysql_connect("$location","$username","$password"); if (!$conn) die ("Could not connect MySQL"); mysql_select_db($database,$conn) or die ("Could not open database"); $query = "INSERT INTO table_name(id,title,message,author,email,date0 VALUES('','$title','$msg','author','email',now())";
$result=mysql_query($query); mysql_close();
Just change the database section and the table name to match your set up.
How would you code it so that it sends you and the form filler a copy of the response to the form?
J.
Add something like this at the end of the insert.php page, before the "?>" tag. This is very basic, you can do more with headers and multiple emails...
$sendto = "$email";
$subject = "Your Information";
$message = "Thank you for your input. It has been added to out database.";
$website = "my_web_site.com";
if($query){//On Success of the insertion mail
($sendto, $subject, $message, $website);
}