Results 1 to 10 of 10

Thread: Form PHP Email Help

  1. #1
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Form PHP Email Help

    I am trying to get this script to work ... i have everything working but i dont get the email... plz can some1 help

    here is the source:-
    <?php
    $pfw_ip= $_SERVER['REMOTE_ADDR'];
    $Handle = addslashes($_POST['Handle']);
    $FirstName = addslashes($_POST['FirstName']);
    $Occupation = addslashes($_POST['Occupation']);
    $ID1 = addslashes($_POST['ID1']);
    $ID2 = addslashes($_POST['ID2']);
    $ID3 = addslashes($_POST['ID3']);
    $Email = addslashes($_POST['Email']);
    $Age = addslashes($_POST['Age']);
    $Country = addslashes($_POST['Country']);
    $CSmaps = addslashes($_POST['CSmaps']);
    $PCDescription = addslashes($_POST['PCDescription']);


    if (strlen($ID1) !=1)
    {
    die("<p align='center'><font face='Times New Roman' size='3' color='#000000'>Please enter a valid Steam ID</font></p>");
    }

    if (strlen($ID1) == 0 )
    {
    die("<p align='center'><font face='Times New Roman' size='3' color='#000000'>Please enter a valid Steam ID</font></p>");
    }

    if (strlen($ID2) !=1)
    {
    die("<p align='center'><font face='Times New Roman' size='3' color='#000000'>Please enter a valid Steam ID</font></p>");
    }

    if (strlen($ID2) == 0 )
    {
    die("<p align='center'><font face='Times New Roman' size='3' color='#000000'>Please enter a valid Steam ID</font></p>");
    }

    if (strlen($ID3) !=7)
    {
    die("<p align='center'><font face='Times New Roman' size='3' color='#000000'>Please enter a valid Steam ID</font></p>");
    }

    if (strlen($ID3) == 0 )
    {
    die("<p align='center'><font face='Times New Roman' size='3' color='#000000'>Please enter a valid Steam ID</font></p>");
    }

    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
    {
    die("<p align='center'><font face='Times New Roman' size='3' color='#000000'>Please enter a valid email address</font></p>");
    }


    $pfw_header = "From: $Email\r\n"
    . "Reply-To: $Email\r\n";
    $pfw_subject = "New Clan Member";
    $pfw_email_to = "myemail";
    $pfw_message = "Visitor's IP: $pfw_ip\r\n"
    . "Handle: $Handle\r\n"
    . "FirstName: $FirstName\r\n"
    . "Occupation: $Occupation\r\n"
    . "ID1: $ID1\r\n"
    . "ID2: $ID2\r\n"
    . "ID3: $ID3\r\n"
    . "Email: $Email\r\n"
    . "Age: $Age\r\n"
    . "Country: $Country\r\n"
    . "CSmaps: $CSmaps\r\n"
    . "PCDescription: $PCDescription\r\n";
    mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;




    echo("<p align='center'><font face='Times New Roman' size='3' color='#000000'>Thank you, you should receive a reply with in 24 hours.</font></p>");
    ?>



    This is the code in my form
    <FORM action=registration.php method=post name="Clan Registration">
    Thanks
    Last edited by NiallM90; 04-29-2006 at 12:21 PM.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Headers should be seperated using CRLF (\r\n) not just LF (\n).
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i tryed that no change

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Use two linebreaks after the last header.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    can u quote that coz im nt sure what u mean

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    $pfw_header = "From: $Email\r\n"
    . "Reply-To: $Email\r\n\r\n";
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    im still not being send an email

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    OK, the next thing to do is to check the return value from the mail() call. If it's TRUE, you've deeper problems at the system level.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Apr 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ... sor this is my first time using .php can u tell me what to do....

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    ]die(mail($pfw_email_to, $pfw_subject, $pfw_message, $pfw_header));
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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