Jump to content

HELP WITH SCRIPT


themisfit

Recommended Posts

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 
}
?>

 

 

Link to comment
Share on other sites

<?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");

.
.
.

?>

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.

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