user data in forms turns into blank email when submitted

Discussion in 'PHP' started by slacker27, Apr 14, 2006.

  1. #1
    i'm trying to set up a street team sign up on my bands web page. i've created the form when it is filled out and submitted i get an email that looks like this:

    firstname:
    lastname:
    address1:
    address2:
    city:
    state:
    country:
    zip:
    phone:
    email:
    comments:

    i can't read what they typed. My .php looks like this:

    @$pfw_ip= $_SERVER['REMOTE_ADDR'];
    @$firstname = addslashes($_POST['firstname']);
    @$lastname = addslashes($_POST['lastname']);
    @$address1 = addslashes($_POST['address1']);
    @$address2 = addslashes($_POST['address2']);
    @$city = addslashes($_POST['city']);
    @$state = addslashes($_POST['state']);
    @$country = addslashes($_POST['country']);
    @$zip = addslashes($_POST['zip']);
    @$phone = addslashes($_POST['phone']);
    @$email = addslashes($_POST['email']);
    @$comments = addslashes($_POST['comments']);


    $pfw_header = "From: $email\n"
    . "Reply-To: $email\n";
    $pfw_subject = "Subject";
    $pfw_email_to = "me@someplace.com";
    $pfw_message = "Visitor's IP: $pfw_ip\n"
    . "firstname: $firstname\n"
    . "lastname: $lastname\n"
    . "address1: $address1\n"
    . "address2: $address2\n"
    . "city: $city\n"
    . "state: $state\n"
    . "country: $country\n"
    . "zip: $zip\n"
    . "phone: $phone\n"
    . "email: $email\n"
    . "comments: $comments\n";
    @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

    header("Location: success.html");

    ?>


    i've been trying to figure it out for two days! it has to be something simple.
    If someone can help me, please do! keep in mind i'm brand new at this, going on two days and one min.
     
    slacker27, Apr 14, 2006 IP
  2. Seiya

    Seiya Peon

    Messages:
    4,666
    Likes Received:
    404
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why do you use the @ before a string definition all the time :(
     
    Seiya, Apr 14, 2006 IP
  3. slacker27

    slacker27 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i took them out, it doesn't change a thing. do you think it might be the box that contains the users text in the html?
     
    slacker27, Apr 14, 2006 IP
  4. himambo

    himambo Peon

    Messages:
    100
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try this code
    use .= to combine all messages

    $pfw_message = "Visitor's IP:" .$pfw_ip\n;
    $pfw_message .= "firstname:" .$firstname\n;
    $pfw_message .= "lastname:" .$lastname\n;
    $pfw_message .= "address1:" .$address1\n;

    .....
     
    himambo, Apr 15, 2006 IP
  5. Lordo

    Lordo Well-Known Member

    Messages:
    2,082
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    190
    #5
    Replace every \n with <br> and let us see the result.
     
    Lordo, Apr 17, 2006 IP
  6. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #6
    We also need to see the HTML page that they're filling out in the first place.

    One thing I'd look at straight up is check that the HTML form is POSTing, not GETting...
     
    TwistMyArm, Apr 17, 2006 IP