How to Create a fprm mail using flash and PHP ?
In this tutorial I will try to help you solve a problem of Who Should address the creation of a form via Flash. The creation of this form provides a component made in Flash and PHP scripts. Since we know That Flash alone can not interact, we will help with the support of a simple PHP script. The lesson is Divided into 5 points know That There Will Be Easier To Understand how it ...
1) Open a blank document and begin to create 4 fields of text input. Give each field name "resort" that will recognize the script of the movie within the field order.
Give an instance name as the first field name, second field Surname third field Email fourth field inquiry. Now create a button for sending 'emails and give instance name
Give an instance name as the first field name, second field Surname third field Email fourth field inquiry. Now create a button for sending 'emails and give instance name
2) Then insert a blank frame in the following Action Script, making sure to replace your url of the script with your data where you see that the code is written in bold:
stop ();
pulsInvio.onRelease = function () (
var Sendmail: LoadVars = new LoadVars ();
sendMail.nome = Nome.text;
sendMail.cognome = Cognome.text;
sendMail.mittente = Email.text;
sendMail.richiesta = Richiesta.text;
sendMail.destinatario = 'destination email messages';
sendMail.onLoad = function (success) (
if (success) (
Nome.text ='';
Cognome.text ='';
Email.text ='';
Richiesta.text ='';
mcMsg.mcTxt.txtMsg.text = this.controllo;
mcMsg.play ();
)
)
sendMail.sendAndLoad ('url php script that generates the email, 'sendmail' POST ');
)
var Sendmail: LoadVars = new LoadVars ();
sendMail.nome = Nome.text;
sendMail.cognome = Cognome.text;
sendMail.mittente = Email.text;
sendMail.richiesta = Richiesta.text;
sendMail.destinatario = 'destination email messages';
sendMail.onLoad = function (success) (
if (success) (
Nome.text ='';
Cognome.text ='';
Email.text ='';
Richiesta.text ='';
mcMsg.mcTxt.txtMsg.text = this.controllo;
mcMsg.play ();
)
)
sendMail.sendAndLoad ('url php script that generates the email, 'sendmail' POST ');
)
As you can see the following Action Script is very simple to understand, now I will explain generally how it works: First insert the action 'stop' to stop the 'time line', then write the name of 'instance of the Send button since the' Action Script revolves around it, alongside as you can see there is action on Release used to communicate to the button to release the mouse on it must start the action.
After that we create a new variable we call Send Mail so that once the recall action with send And Load this bringing together all the field names and sending input to the script which will then send the email to our mail.
Now where is the action sending Mail? In destination insert our email, while the last action type the URL where the script is located within our site preferably is located in the same folder where the flash movie.
After that we create a new variable we call Send Mail so that once the recall action with send And Load this bringing together all the field names and sending input to the script which will then send the email to our mail.
Now where is the action sending Mail? In destination insert our email, while the last action type the URL where the script is located within our site preferably is located in the same folder where the flash movie.
3) Now we proceed with creating a script worthy FIRST SECOND functions and is easy to guess. Open the common Windows Notepad and write the following code and then save it with the name email. php . This too is quite simple enough to understand that you have a minimum basis of php that will be easy to read and understand:
<? Php
$ Name = stripslashes ($ _POST ['name']);
$ Name = stripslashes ($ _POST ['name']);
$ Sender = stripslashes ($ _POST ['sender']);
$ Request = stripslashes ($ _POST ['request']);
$ Sms = '
<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title> Contacts </ title>
</ Head>
<body style="margin:0px;">
<table cellpadding="0" cellspacing="0" style="height:100%;width:500px;">
<tr>
<td style="height:100%;padding:20px;vertical-align:top;">
<table>
<tr> <td colspan="2">
<Img src = "URL of your custom image"alt =" "/>
</ Td>
</ Tr>
<tr> <td width="110"> <b> Name: </ b> </ td>
<td width="300">. '$ name.' </ td> </ tr>
<tr>
<td> <b> Name: </ b> </ td>
<td>. '$ surname.' </ td> </ tr>
<tr>
<td> <b> E-mail: </ b> </ td>
<td>. '$ sender.' </ td> </ tr>
<tr>
<td> <b> Request: </ b> </ td>
<td> '. $ request.' </ td> </ tr>
</ Table> </ td> </ tr>
</ Table>
</ Body>
</ Html> ';
$ Headers = "From: $ name $ surname <$ sender> \ n";
$ Headers .= "Content-Type: text / html; charset = iso-8859-1 \ n";
if (mail ($ _POST ['recipient'], $ subject, $ sms, $ headers)) (
echo 'check & send = done successfully.';
)
else (
echo '& error = check e-mails sent.';
)
?>
$ Name = stripslashes ($ _POST ['name']);
$ Name = stripslashes ($ _POST ['name']);
$ Sender = stripslashes ($ _POST ['sender']);
$ Request = stripslashes ($ _POST ['request']);
$ Sms = '
<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title> Contacts </ title>
</ Head>
<body style="margin:0px;">
<table cellpadding="0" cellspacing="0" style="height:100%;width:500px;">
<tr>
<td style="height:100%;padding:20px;vertical-align:top;">
<table>
<tr> <td colspan="2">
<Img src = "URL of your custom image"alt =" "/>
</ Td>
</ Tr>
<tr> <td width="110"> <b> Name: </ b> </ td>
<td width="300">. '$ name.' </ td> </ tr>
<tr>
<td> <b> Name: </ b> </ td>
<td>. '$ surname.' </ td> </ tr>
<tr>
<td> <b> E-mail: </ b> </ td>
<td>. '$ sender.' </ td> </ tr>
<tr>
<td> <b> Request: </ b> </ td>
<td> '. $ request.' </ td> </ tr>
</ Table> </ td> </ tr>
</ Table>
</ Body>
</ Html> ';
$ Headers = "From: $ name $ surname <$ sender> \ n";
$ Headers .= "Content-Type: text / html; charset = iso-8859-1 \ n";
if (mail ($ _POST ['recipient'], $ subject, $ sms, $ headers)) (
echo 'check & send = done successfully.';
)
else (
echo '& error = check e-mails sent.';
)
?>
4) Now just put online and the SWF file that the script ET voila you're done. If you had problems please comment on whether any one of the steps there was clear.
Tags: Flash, PHP
Subscribe to:
Post Comments (Atom)
Share your views...
0 Respones to "How to Create a fprm mail using flash and PHP ?"
Post a Comment