WordPress.org

Ready to get started?Download WordPress

Forums

footercontact.php won't autofill (1 post)

  1. gpparsons
    Member
    Posted 5 years ago #

    Hello,

    I have the following footer contact form that will not google autofill. it also autoresponds email with BuildersEngineering.com@web257.opentransfer.com as the from email name and address. Can anyone tell me how to revise the form to 1) autofill and 2) have the autoresponse email from gparsons@BuildersEngineering.com?

    Thanks,
    Greg

    <?php
    $to = 'gparsons@buildersengineering.com';
    $from = $_REQUEST['email'] ;
    $name = $_REQUEST['name'] ;
    $headers = "From: $from";
    $subject = "Web Contact Data";

    $fields = array();
    $fields{"name"} = "Name";
    $fields{"email"} = "Email";
    $fields{"message"} = "Message";

    $body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }

    $headers2 = "From: BuildersEngineering.com";
    $subject2 = "Thank you for contacting us";
    $autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our website at http://www.buildersengineering.com";

    if(($from == '') || ($from == 'Email')) {echo "You have not entered an email, please go back and try again";}
    else {
    if(($name == '') || ($name == 'Name')) {echo "You have not entered a name, please go back and try again";}
    else {
    $send = mail($to, $subject, $body, $headers);
    $send2 = mail($from, $subject2, $autoreply, $headers2);
    if($send)
    {header( "Location: http://www.buildersengineering.com/home/?page_id=334" );}
    else
    {print "We encountered an error sending your mail, please notify webmaster@buildersengineering.com"; }
    }
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic