I have a feeling this is a simple fix, but I am having some trouble with this one. I have a contact form that I do not want going to a "thank you" page.
Here is the code I am using on the php sending page
I pulled out [header("Location:thankyou.html");] but when I hit the submit button the page opens my send.php page.PHP Code:<?php
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$message = $_REQUEST['message'];
$to = "xxxx@xxxx.com";
$ToName = "My Name";
$date = date("m/d/Y H:i:s");
$ToSubject = "Email From $name";
$EmailBody = "Sent By: $name at $email
<br /><br />
Message Sent:
<br />$message<br /><br />";
$message = $EmailBody.$EmailFooter;
mail($to, $ToSubject, $message, $headers . "From:$name <".$email.">");
header("Location:thankyou.html");
?>
I want to be able to hit the submit button and just have the data pass to email without the form page changing as I am usng jQuery to change the div contents. *The site is a single page with jQuery for scrolling.
If anyone knows how to stop the page from changing when I hit submit, that would be great.
*Note: I did try changing 'thankyou.html' to the current page name, but since it is a single page with animated scroll it refreshes the whole page so the jQuery div change doesnt apply and the form resests.



Reply With Quote


Bookmarks