On my website I have a 'Contact Us' form.
Currently, I am using a php form to have the information that has been filled out on the form to be e-mailed to my e-mail.
I wanted an echo message to come up once someone clicks on submit, but instead it's going to another page with the message there.
I just want the page to refresh.
This is the PHP Code:
<?php
//echo $emailBody;
sendEmail();
function sendEmail(){
global $emailBody, $name, $from, $fromName, $templateFile, $to, $subject;
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "Reply-To: ". $from . "\r\n";
$headers .= "From: ". $from . "\r\n";
$headers .= "Return-Path: ".$from;
if (!mail($to, $subject, $emailBody, $headers)) {
} else {
echo "Your Message has been sent!we will contact back you in a short moment!";
}
}
?>