broada28 Posted June 20, 2013 Share Posted June 20, 2013 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: <?php$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$validationOK=true;if (!$validationOK) {echo "please check your details";header("Location: http://prowinduk.com/contact/send_email.php");exit;}// 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 pageif ($success){print "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";}else{print "<meta http-equiv=\"refresh\" content=\"1;URL=index.php\">";}?> Quote Link to comment https://forums.phpfreaks.com/topic/279388-contact-form-reset-and-message/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.