开发者

Sending mail through PHP from a Flash application

开发者 https://www.devze.com 2023-02-20 01:27 出处:网络
I am building a flash website and I want contact information sent to my gmail address. The Lynda.com tutorial I am using says I need to \"enter the php address.\"What is that and how do I do it?

I am building a flash website and I want contact information sent to my gmail address.

The Lynda.com tutorial I am using says I need to "enter the php address." What is that and how do I do it?

This is my code edited

if (thename.text == "" || theemail.text == "" || thephone.text == "" || themessage.text =="") {
    thefeedback.text = "*Please fill out all fields";
} else {
    var allvars:URLVariables = new URLVariables()
    allvars.name = thename.text;
   开发者_C百科 allvars.email = theemail.text;
    allvars.phone = thephone.text;
    allvars.message = themessage.text;

    // Send info to a new request
    var mailAddress:URLRequest = new URLRequest("http://whatever goes here.php");
    mailAddress.data = allvars;
    mailAddress.method = URLRequestMethod.POST;
    sendToURL(mailAddress);
    thefeedback.text = "Thank You";
    thename.text = "";
    theemail.text = "";
    thephone.text = "";
    themessage.text = "";
}


Presumably they mean "A URL that resolves to the PHP script that they taught you to write", but "php address" is not a standard term.


When you press submit on any form it is taking that information (first name, last name, body text, etc) and then it needs to be sent somewhere so that it can be given to gmail or anther email service as an actual email.

Now PHP on a server can take the information, turn it into an email, and send it from you to them.

You can do this by using POST and the URL is to a PHP script that lives somewhere.

Now that script needs set up, you can learn how HERE

Good luck friend!


You can use Zend PHP to use PHP functions from Flash.

This tutorial is pretty good: http://www.flepstudio.org/forum/tutorials/3421-actionscript-3-0-zend-amf.html

0

精彩评论

暂无评论...
验证码 换一张
取 消