Form Help

I am trying to set up a form on my website that when submitted it sends an auto reply email to the address provided in the form ((‘POST’,‘Email’)). Here is the code that I have so far, but I need the code to do the auto reply.

[code]<?php
include(“global.inc.php”);
$errors=0;
$error=“The following errors occured while processing your form input.

    ”;
    pt_register(‘POST’,‘Name’);
    pt_register(‘POST’,‘Phone’);
    pt_register(‘POST’,‘Email’);
    pt_register(‘POST’,‘Whereyoufoundus’);
    pt_register(‘POST’,‘Message’);
    $Message=preg_replace("/(1512)|(15)|(12)/"," 
    “, $Message);if($Name==”" || $Phone=="" || $Email=="" || $Message=="" ){
    $errors=1;
    $error.=“
  • 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("[email protected]”,“Form Submitted at your website”,$message,“From: phpFormGenerator”);

    header(“Refresh: 0;url=http://mysite.com/thanks.html”);
    ?><?php
    }
    ?>[/code]

    Any help would be greatly appreciated.

Not sure what you’re trying to say there, or what your problem is. You say you need the code for an auto-reply? How does what you’ve tried not work? Did it give any errors?

Sponsor our Newsletter | Privacy Policy | Terms of Service