Jump to content

Macromedia Flash Site and PHP email POST


jrmgolem

Recommended Posts

I have a web template that is written in FLASH and has a feedback comment box that asks the user to enter thier name email and a comment.

The FLASH site uses an HTML file for data configuration, and the variable for the email adress is set as $recipient, I have looked in the tutorials and do not see how to get the email to be sent to me including the comment.

Within the FLASH code are the variables for $your_name $your_email and $message, is there an example in the tutorials to show me how to do the post form?

I appologise if this has been covered somewhere, but I couldnt find a search result for this that deals with FLASH and PHP.

Cheers! :-)
Link to comment
Share on other sites

you need to have all of the input boxes and your button in the same MC and give it an instance name of formMC or whatever you want. You can also add a dynamic text box and give it a var of "status" so that people know what's going on when they submit the form

then on your button add

[code]
on (release) {
        if (!your_email.length || your_email.indexOf("@") == -1 || your_email.indexOf(".") == -1) {
        status = "Please enter a valid E-mail address";
    }

    else if (!your_name.length) {
        status = "Please Enter your name before Sending";
    }

    else if (!message.length) {
        status = "Please enter some text in you message";
    }
    
    else {
        loadVariablesNum ("send.php", "0", "Post");
        status = "Sending... ";
    }
}
[/code]

and in your send.php you do it like every other php form, you make it collect the info using $_POST and mail the message. To send back info to your status box just add

Print "_root.formMC.status=Your mail has been sent";

after your mail() function

[!--quoteo(post=380632:date=Jun 6 2006, 11:24 AM:name=AgentSmith)--][div class=\'quotetop\']QUOTE(AgentSmith @ Jun 6 2006, 11:24 AM) [snapback]380632[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I have a web template that is written in FLASH and has a feedback comment box that asks the user to enter thier name email and a comment.

The FLASH site uses an HTML file for data configuration, and the variable for the email adress is set as $recipient, I have looked in the tutorials and do not see how to get the email to be sent to me including the comment.

Within the FLASH code are the variables for $your_name $your_email and $message, is there an example in the tutorials to show me how to do the post form?

I appologise if this has been covered somewhere, but I couldnt find a search result for this that deals with FLASH and PHP.

Cheers! :-)
[/quote]
Link to comment
Share on other sites

Thank you very much for such a speedy response!

I have read the code you have provided, but I would be grateful of the corresponding PHP code as well, I have no clue what I am doing here LOL but I will try to post the flash code:

[code]

This is the code for the send action:

on (rollOver) {
    this.gotoAndPlay("s1");
}
on (releaseOutside, rollOut) {
    this.gotoAndPlay("s2");
}
on (release) {
    url_var = "server_option="+_root.server_option+"&recipient="+_root.recipient+"&your_name="+_parent.your_name+"&your_email="+_parent.your_email+"&message="+_parent.message;
    getURL("contact."+_root.server_option+"?"+url_var, "_self", "GET");
    _parent.your_name = "";
    _parent.your_email = "";
    _parent.message = "";
}

This is the code for the variables:

//t1.onSetFocus=function(){if(t1_2=="your name") {t1_2=""} }
t2.onSetFocus=function(){ if(your_email=="your e-mail") {your_email=""} }
t3.onSetFocus=function(){ if(message=="your comments here") {message=""} }
t4.onSetFocus=function(){if(your_name=="your name") {your_name=""} }

[/code]

I hope this is clearer to you!

Thanks again
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.