Question about the php coding for ACTION.php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ClevelandSlim
    Private

    • Apr 2008
    • 1

    Question about the php coding for ACTION.php

    I have scoured the forum looking for the help I needed, and I now have a form working on my page.

    My question now is...

    -----

    <?PHP
    $mailto = "playerzmediafilms******.com";
    $email = $HTTP_POST_VARS['email'];
    if ($email == "") {
    $email = $mailto;
    }
    $mailsubj = "testing tiffany's mail form";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form :\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>

    -----

    This coding is sending the form data to MY EMAIL, but it is also placing MY EMAIL as the FROM section of the email as well.

    How do I get the form submission to come to inbox with the person who submitted the form's email address in the FROM box (so I can reply by simply hitting reply?

    Thank you for any help.
    ~Slim~
  • Andy128
    Major General

    • Dec 2005
    • 2317

    #2
    Re: Question about the php coding for ACTION.php

    Make the email field a mandatory field. That way they cannot send the form unless they input an email address.

    Do do this, simply click on the email filed and then click on the Validate tab. Click on the box that has "No constraints" and choose Email Address.
    Then put a check in the Csutom Error Message box. In the box below that- write your message like: Please put a valid Email address in the Email field. Thank you.

    Then below that, put a check in the data required and set your minimum and max character limites (5 and 45 should do).

    Click ok. Save and Publish.

    Andy
    PHP- is a blast!

    Comment

    • navaldesign
      General & Forum Moderator

      • Oct 2005
      • 12080

      #3
      Re: Question about the php coding for ACTION.php

      The script uses your own email address as "From" email address, if the "email" field in the form is empty. It does this because if no "From" email address is included, most ISPs will block the mail.

      The problem can arise if the visitor's email address field is named something different than "email" (in example, UPPER CASE "E") or no email address is filled in. In these cases the script PURPOSELY uses your own email address as "From".
      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!

      Comment

      Working...
      X