Jump to content

Post through details of a form without refreshing a page


joesaddigh

Recommended Posts

Hi,

 

I want to submit a form but not actually refresh the page.

 

Is this possible?

 

For example if I have this code below and the send_quote_as_enquiry.php is just a form which I populate certain values. I want to submit this without refreshing the page but make it trigger something so tha I can submit the details if necessary.

 

//---------------------------------------------------------------------------------------------------------------
	// Show the enquiry form
	include("send_quote_as_enquiry.php"); 
	//---------------------------------------------------------------------------------------------------------------

	//---------------------------------------------------------------------------------------------------------------
	$j = false;

	if ( $j )
	{
		// Insert the data 
		//Get personal details from enrolment form
		$firstname = mysql_real_escape_string($_POST["first_name"]); 
		$surname = mysql_real_escape_string($_POST["surname"]);
		$email = mysql_real_escape_string($_POST["email"]);
		$subject = mysql_real_escape_string($_POST["subject"]);
		$question = mysql_real_escape_string($_POST["question"]);

		// Insert enquiry data 
		$query = "INSERT INTO enquiry(enquiry_id,email, subject, content, first_name, surname, date, replied)
		VALUES(0, '$email', '$subject', '$question', '$firstname', '$surname', NOW(), 'no')";
		$result = mysql_query($query) 
			or die("Error making contact");
	}

 

Thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.