I have problems Getting VRS from POST . Please Help

Discussion in 'PHP' started by laruca, Oct 2, 2008.

  1. #1
    Hello !
    I designed a letter for the people registered to the newsletter from a website of mine in wich i request feedback from them from time to time . The letter is in HTML format. The letters asks for numbers of news submited, review for last month and stuff like that .
    So, the problem is that, when they receive their mail, after filling the requested fields and clicking SUBMIT, it goes fo the .php that get the post vars for the fields and mails them to my e-mail. But I aint getting no info. The fields come blank to me.

    Here is a part of the html code for the fields :

    <form name="main" id="main" method="post" action="link/process.php">
    Code (markup):
    ....
    <td class="label" width="320"><label for="fullname"><sup><img src="link/files/asterisk.gif" border="0"></sup>Full Name:</label></td>
    <td width="2">&nbsp;</td>
    <td width="418"><input class="" id="fullname" name="fullname" size="20" value="" type="text"></td>
    </tr>
    <tr>
    <td class="label" width="320"><label for="submitno"><sup><img src="link/asterisk.gif" border="0"></sup>Number Of Submited News:</label></td>
    <td width="2">&nbsp;</td>
    <td width="418"><input class="" id="submitno" name="submitno" size="4" value="" type="text"></td>
    </tr>
    Code (markup):
    ...
    input type="submit" name="set" value="Submit Feedback">
    Code (markup):
    Okay, and now after clicking submit, they get redirect to the php, wich code is this :

    <?php
    $fullname=$_POST['fullname'];
    $submitno=$_POST['submitno'];
    $email="paulpierce4@gmail.com";
    mail($email,"Name : $fullname \n Submited News : $submitno");
    header("location: link_to_website");
    
    Code (markup):
    After they get redirected to website, and I receveing mail, i get no info .
    The only thing i get is
    Name :
    Submited News :

    but without any info .

    Where am I mistaking ? Can anyone please help me ?
    Thank You in advance .
    Best regards .
     
    laruca, Oct 2, 2008 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    you are using lable with same name

    try to change of labels to something else
    <label for="fullname1">

    All lablel names

    Regards

    Alex
     
    kmap, Oct 2, 2008 IP
  3. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #3
    second error is in this line

    mail($email,"Name : $name

    $name no such variable


    Regards

    Alex
     
    kmap, Oct 2, 2008 IP
  4. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #4
    the second parameter for mail() is the subject, and the subject should not contain any newline character (\n) or else problem will occurs

    try this
    
    $subject = 'YOUR SUBJECT HERE';
    $fullname=$_POST['fullname'];
    $submitno=$_POST['submitno'];
    $email="paulpierce4@gmail.com";
    mail($email, $subject, "Name : $fullname \n Submited News : $submitno");
    header("location: link_to_website");
    
    PHP:
    and you put $name as the Name instead of $fullname in the mail() function.
     
    ads2help, Oct 2, 2008 IP
  5. laruca

    laruca Peon

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    the $name/fullname was my mistake now when writing the post.
    Thank you for your help .
    Is there anything else i should now ?
    Best regards .
     
    laruca, Oct 2, 2008 IP
  6. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #6
    have u try sending the mail?
     
    ads2help, Oct 2, 2008 IP
  7. laruca

    laruca Peon

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i'm at work right now. dont have the software requiered for testing. just want to collect all the info until i get home.
    i`ll try it in 2-3 h when i get back. thank you somuch for helping
     
    laruca, Oct 2, 2008 IP
  8. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #8
    you're welcomed. it should be working.
     
    ads2help, Oct 2, 2008 IP