PHP send mail script isn't sending the form fields

Discussion in 'PHP' started by mickapoo, Oct 17, 2008.

  1. #1
    I have an HTML form that has both an email address and a name field.

    When I submit the form, I do receive the email, but the only thing that is in the email is the users email address. The name that they enter is there. And the field name is lower case, just as it is below.


    Here is my PHP script:
    <?php
    $email = $_POST['email'] ;
    $message = $_POST['name'] ;


    mail( "info@hybriddesign.net", "World Summit Opt In",
    $message, "From: $email" );
    header( "Location: http://www.1internetbusinesscenter.com/sales_letter.html" );
    ?>


    Can you tell me why I may not be receiving the name in the email?

    And also, if I want to add more fields to the form, how would I do that? Would I change it to
    $message = $_POST['name', 'other field name', 'other field name'] ?


    Thank you!
     
    mickapoo, Oct 17, 2008 IP
  2. fireworking

    fireworking Peon

    Messages:
    460
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I dont think you ever specified the FROM address to the email. You need to set a to, but you will also need to set a from.
     
    fireworking, Oct 17, 2008 IP
  3. PottingNoob

    PottingNoob Banned

    Messages:
    223
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    PottingNoob, Oct 17, 2008 IP