+ Reply to Thread
Results 1 to 2 of 2

Thread: Simple contact form problems with php script
      
   

  1. #1
    johnlomb is offline Private
    Join Date
    Dec 2006
    Posts
    3

    Red face Simple contact form problems with php script

    I set up a contact form on the index page at www.drink4health.biz

    I used the step by step instructions at

    http://youandmelinkup.info/forms/stepbystep.html

    The form sends e-mail, but it uses the address typed in the e-mail box instead of my address. I typed my address into the processingpage.php script (j.lomb@comcast.net) as instructed, but somehow I keep getting this unexpected result. The information is just resent back to the person who is trying to register.

    This is the content of the file processingpage.php

    <?PHP
    // Receiving variables
    @$name = addslashes($_POST['name']);
    @$email = addslashes($_POST['email']);
    @$comments = addslashes($_POST['comments']);
    // error checking
    if (strlen($name) == 0 )
    {
    header("Location: name_error.html");
    exit;
    }
    if (strlen($email) == 0 )
    {
    header("Location: email_error.html");
    exit;
    }
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: email_error.html");
    exit;
    }
    if (substr_count($comments, '@') > "2")
    {
    header("Location: comments_error.html");
    exit;
    }
    //Sending Email to form owner
    $mailto = "j.lomb@comcast.net";
    $mailsubj = "Feedback from my website form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values from my website form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    // Autoresponder
    $mailto = "j.lomb@comcast.net";
    $mailsubj = "Copy of the info you Submitted";
    $mailhead = "From: website form\n";
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    header("Location: confirmationpage.html");
    ?>



    Thank you.

    John Lombaerde

  2. #2
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Simple contact form problems with php script

    Ok, i tested the form and i received the autoresponder message.

    Please note that as you have set it now, it is wrong. You will send BOTH the main message AND the autoresponder message to your self. Probably, as it was before, it was correct: sending one mail to you, and the autoresponder mail to the visitor.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49