A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: PHP mail HELP...please

  1. #1
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746

    PHP mail HELP...please

    This is DRIVING ME NUTS!!! I finally made the switch from Swish to Flash, thanks to a great (old) book called foundation Flash 5. The movie works great! My forum USED to work on PHP4 but now I am on a server running PHP5. Now my form doesn't work

    I have a very simple form. 3 text blocks with vars of fullname, email, and message.

    This is the code for my send button
    Code:
    on (release)
    {
        if (fullname eq "" || email eq "" || message eq "")
        {
            stop ();
        }
        else
        {
            loadVariablesNum("/form.php", 0, "POST");
    		gotoAndStop(50);
    		
        } // end else if
    }
    This is the code to my form.php
    Code:
    <?php
    $fullname=$_GET['fullname'];
    $email=$_GET['email'];
    $message=$_GET['message'];
    
    $to="support@weather4powerpoint.com";
    $subject="Contact Form from Wx4PPT";
    mail($to,$subject,$message,"From: Weather 4 PowerPoint Contact Page\nReply-To: $email\n");
    ?>
    When I get the email I get the subject, from and to.. NOTHING in the body of the email??? if you can help I will GREATLY appreciate it!

    The site with the form is, if you have not already noticed http://www.weather4powerpoint.com chose flash and click contact in the menu.

    Thank you for any help that you can offer.
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try using -
    $fullname=$_POST['fullname'];
    etc..etc

  3. #3
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    that works but it only sends the message not the email or the fullname.. I have tried this

    Code:
    <?php
    $fullname=$_POST['fullname'];
    $email=$_POST['email'];
    $message=$_POST['message'];
    
    $to="support@weather4powerpoint.com";
    $subject="Contact Form from Wx4PPT";
    mail($to,$subject,$fullname,$email,$message,"From: Weather 4 PowerPoint Contact Page\nReply-To: $email\n");
    ?>
    the form will not even send.. so I removed $fullname and $email tested and it sent $message.. so I renamed $message to $email and it sent.. can you show me the best way to send fullname, email, and message within the body?

    Thank you again for your help!
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    1. what version of Flash are you using ?
    2. are you certain that your variable names for the textfields are correct ?

  5. #5
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    Using Flash MX

    text fields are (fullname, email, message) and they are all set to input text fields.
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try using loadvars -
    Code:
    // button code -
    on (release){
     if (fullname eq "" || email eq "" || message eq "") {
     stop ();
    } else {
     _root.sendMail();
    gotoAndStop(50);
    } // end else if
    }
    Code:
    // code on frame with textfields (variable names)
    function sendMail(){
    lv = new LoadVars();
    lv.fullname = _root.fullname;
    lv.email = _root.email;
    lv.message = _root.message;
    lv.onLoad = function(){
    trace(unescape(this));
    }; // end onLoad
    lv.sendAndLoad("full path to php", lv, "POST");
    } // end sendMail
    send some feedback from your php to see if the variables are received
    echo "&mailVar=".$email."&";
    this will show in your output window as a result of the onLoad function

  7. #7
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    confused as to where to add the second code? they are layer 13,14 and 15.. can you heads up how I would add this?

    thanks your help is GREATLY appreciated!


    If you need I can upload the FLA to my server
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  8. #8
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    where to add the second code

    on the frame number that covers the textfields

    ie .. textfields on frame#1, layers 13, 14, 15
    code on frame#1, layer 12

  9. #9
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    I did that and got no email?

    I will PM you the addy for the FLA and form.. if you can look at it that would be great.. thank you agian
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  10. #10
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    nm here is the link.. it wont let me email you

    http://www.weather4powerpoint.com/wx4ppt.zip

    it contains the form and the FLA
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  11. #11
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    altered your file and sent test message.
    can you check your email ?

  12. #12
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    BTW I am running MX V6
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  13. #13
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    checked and nothing
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  14. #14
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    prolly better if you do the testing

    http://www.jackleaman.co.uk/temp/NEWsoftware_site2.zip

  15. #15
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    ok will test it and let you know
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  16. #16
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    it still only sends message.. it has to be in this code

    Code:
    mail($to,$subject,$message,"From: Weather 4 PowerPoint Contact Page\nReply-To: $email\n");
    ?>
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  17. #17
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try this for form.php -
    PHP Code:
    <?php
    $fullname
    =$_POST['fullname'];
    $email=$_POST['email'];
    $message=$_POST['message'];
    $date date("m/d/Y H:i:s");
    $to="support@weather4powerpoint.com";

    if (
    $REMOTE_ADDR == ""$ip "no ip";
    else 
    $ip getHostByAddr($REMOTE_ADDR);

    mail($to,"Contact Form from Wx4PPT",
    "A visitor has left the following information\n
    Name : 
    $fullname 
    Email : 
    $email\n
    The visitor commented:
    ------------------------------
    $message

    Logged Info :
    ------------------------------
    Using: 
    $HTTP_USER_AGENT
    Hostname: 
    $ip
    IP address: 
    $REMOTE_ADDR
    Date/Time:  
    $date"); 
    ?>

  18. #18
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    Ok I got it to work! Now I am working on adding a carriage return so that the output doens't look bad.

    Here is the code I figured that $msg is $message in PHP5
    Code:
    <?php
    $message =$_POST['fullname'];
    $message .=$_POST['email'];
    $message .=$_POST['message'];
    
    $to="support@weather4powerpoint.com";
    $subject="Contact Form from Wx4PPT";
    mail($to,$subject,$message,"From: Weather 4 PowerPoint Contact Page\nReply-To: $email\n");
    ?>
    This is the output that I get
    fullname
    emailmessage

    I want

    fullname
    email
    message
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  19. #19
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    OK will do.. thanks

    Quote Originally Posted by a_modified_dog
    try this for form.php -
    PHP Code:
    <?php
    $fullname
    =$_POST['fullname'];
    $email=$_POST['email'];
    $message=$_POST['message'];
    $date date("m/d/Y H:i:s");
    $to="support@weather4powerpoint.com";

    if (
    $REMOTE_ADDR == ""$ip "no ip";
    else 
    $ip getHostByAddr($REMOTE_ADDR);

    mail($to,"Contact Form from Wx4PPT",
    "A visitor has left the following information\n
    Name : 
    $fullname 
    Email : 
    $email\n
    The visitor commented:
    ------------------------------
    $message

    Logged Info :
    ------------------------------
    Using: 
    $HTTP_USER_AGENT
    Hostname: 
    $ip
    IP address: 
    $REMOTE_ADDR
    Date/Time:  
    $date"); 
    ?>
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

  20. #20
    Godfather of SWiSH
    Join Date
    Jun 2000
    Location
    WY
    Posts
    746
    ok here is the output

    Code:
    A visitor has left the following information
    
    Name : 
    aaron
    Email : test@xxxx.com
    
    The visitor commented:
    ------------------------------
    test message
    
    Logged Info :
    ------------------------------
    Using: 
    Hostname: no ip
    IP address: 
    Date/Time:  08/19/2006 16:41:45
    VERY NICE! one last thing.. what do I add in the code to make is show a from address instead of Nobody [nobody@server1.wxalliance.com]

    Thank you SO MUCH!
    Do you like Weather? Then check out WxChat.com
    If you want what the crazy Philippians got, then you need to do what the crazy Philippians did!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center