View Full Version : Form Submission

11-10-2006, 03:27 AM
Okay, so I am still new to some of this. Here is my delimma - I have a form that is completed and the user hits the submit button. Unfortunately when they do this it return to the same form. When I change the coding to go to another url upon submission it does that but it does not submit the form information into my databse. How can I get it to submit the info and then route to another page. The form is at www.bvya.com/survey.php and the page it should route to after the information is submitted to the database is www.bvya.com/survey_end.htm

11-10-2006, 03:35 AM

mysql_query("insert into yourtable (name, email, comment) values('$name','$email','$comment')") or die("Unable to create");
print "SUCCESS!";
print "<meta http-equiv='refresh' content='2;url=page.php>";

The form method is POST and the action is the file your sending the information to. The $name=$_POST["name"]; pulls info from your form... easily done! The Meta tag simply refreshes the browsers into another page after data was input into the database! If you have any further questions, dont be afraid to ask :-)