themisfit Posted February 22, 2008 Share Posted February 22, 2008 This is my current script for my contact page. What I would like to know is how to make the script to auto reply to the email address provided in the web form. below is the script to this point any help would be appreciated. <?php include("global.inc.php"); $errors=0; $error="The following errors occured while processing your form input.<ul>"; pt_register('POST','Name'); pt_register('POST','Phone'); pt_register('POST','Email'); pt_register('POST','Whereyoufoundus'); pt_register('POST','Message'); $Message=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Message);if($Name=="" || $Phone=="" || $Email=="" || $Message=="" ){ $errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; } if($errors==1) echo $error; else{ $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); $message="Name: ".$Name." Phone: ".$Phone." Email: ".$Email." Where you found us: ".$Whereyoufoundus." Message: ".$Message." "; $message = stripslashes($message); mail("mysite@mysite.com","Form Submitted at your website",$message,"From: Contact Form"); header("Refresh: 0;url=http://mysite.com/thanks.html"); ?><?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/92510-help-with-script/ Share on other sites More sharing options...
Psycho Posted February 22, 2008 Share Posted February 22, 2008 <?php . . . $message = stripslashes($message); mail("mysite@mysite.com","Form Submitted at your website",$message,"From: Contact Form"); mail($Email, "Thank You","Your message was received","From: mysite@mysite.com"); header("Refresh: 0;url=http://mysite.com/thanks.html"); . . . ?> Quote Link to comment https://forums.phpfreaks.com/topic/92510-help-with-script/#findComment-474007 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.