A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Please edit my script

  1. #1
    Learn more, know less.
    Join Date
    Jul 2004
    Posts
    169

    Please edit my script

    I am trying to do what seems like a simple email from flash using PHP. I have a bunch of text fields, the send button checks to see if everything has been filled out and then goes to a PHP script to actually send the email.

    Everything works until I hit "send" and then it just seems not to communicate with the script. The email status doesn't change and no email is sent.This is the code I have right now:
    Code:
    <&quest;
    
    $ToEmail = "[email protected]";
    
    $ToName = "Creative Director, Joel Marsh";
    
    $ToSubject = "Website Inquiry";
    
    $EmailBody = "Sent By: $FormName\nSenders Email: $FormEmail\nSenders FormSite: $Company\n\n Message Sent:\n$FormComments\n\n";
    
    $EmailFooter="\nThis message was sent by: $FormName .\n If you feel that you recieved this e-mail by accident please contact us at www.TheHipperElement.com";
    
    $Message = $EmailBody.$EmailFooter;
    
    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");
    
    Print "_level0.EmailStatus='Thank You.'";
    
    &quest;>
    What do you think? It's in the same directory as the swf running the code.

    Thanks.
    Last edited by JoelTHE; 10-12-2005 at 08:39 PM.

  2. #2
    Flasher
    Join Date
    Jun 2005
    Posts
    1,365
    It sounds like an AS error. Post the AS and I'll take a look.....

  3. #3
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    it more sounds like a php problem - most servers these days require to pick up the data with code like
    $FormName = $_POST['FormName'];
    $FormEmail = $_POST['FormEmail'];
    Also, some mailers prefer a plain $ToMail instead of the $ToName." <".$ToEmail.">" construct.

    If this does not help, please post url of the actual swf file for testing

    Musicman
    Last edited by Musicman; 10-13-2005 at 02:00 AM.

  4. #4
    Learn more, know less.
    Join Date
    Jul 2004
    Posts
    169
    Thanks for the replies, but I think I'm with you Musicman, the actionscript works in isolation, so I'm thinking it works well...for now.

    I'm relatively experienced in Flash but new to PHP, could you elaborate on what you were saying? My code is straight out of a tutorial and then edited...so a little explanation would go a long way with me.

    Thanks for your help.

  5. #5
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    you are using a tutorial that is pretty old - there is a successor at www.flash-db.com
    Some time ago (see the "php not working" thread near the top of the page) the behaviour of php was changed for security reasons. There are still very few hosts setting compatibility to the old model, though.
    Before that change, any data received from the web automatically became a php variable; today all variables that are wanted need to be explicitly received. [Consider a discussion forum that sets a variable $admin when the person logging in is recognized as admin but nothing is done otherwise, and an intruder that just adds admin=1 to data sent from the browser]
    The revised tutorial will show a similar change on the AS side: sending only variables meaningful to the email script - where the old one typically would add last preloader percentage and similar things to the data

    Musicman

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