Jump to content

Contact Form Reset and Message


Recommended Posts

Hi everyone, this is my first time using php.


i have made a basic contact form and hosted it, (http://www.prowinduk.com/contact/index.html)


how do i make it so after the form has been sent, it resets the form and shows a message saying "message sent"

please can some one help, i am using dreamweaver cs5.


sorry if this has been mentioned in the past as i searched all over but could not find a answer.


any help/advise would be usehull, thanks



below is the text code stuff:






$EmailFrom = "online@prowinduk.com";
$EmailTo = "turbine@prowinduk.com";
$Subject = "online form";
$Name = Trim(stripslashes($_POST['name']));
$Email = Trim(stripslashes($_POST['email']));
$Tel = Trim(stripslashes($_POST['tel']));
$Message = Trim(stripslashes($_POST['message']));
$Pcode = Trim(stripslashes($_POST['pcode']));
// validation
if (!$validationOK) {
echo "please check your details";
header("Location: http://prowinduk.com/contact/send_email.php");

// prepare email body text

$Body = "";
$Body .= "Full Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Telephone #: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "E-mail: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Message;
$Body .= "\n";
$Body .= "Postcode: ";
$Body .= $Pcode;
$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";
print "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.