Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
Making a Mail Form with Flash and PHP
Category : Flash | Level : Intermediate | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

SENDING MAIL THOURGH FLASH AND PHP

There are only a few steps for sending mails through Flash and PHP.
First thing is ofcourse to design an interface using that you will be for
sending mails, and the second portion is the PHP code. So we will start
with the first portion to make an interface and attach Variables with
input boxes.

FLASH PART
We will add four input boxes for
To
From
Subject
Body

--------------------------
---- Follow the steps ----
--------------------------
1. Pick up the Text Tool and write To, From, Subject, Body
in a static form. Choose Static from text box properties like this
user posted image

2. Now make another TEXT box using TEXT Tool and set its properties as
input box, like this
user posted image
and place it in front of text To, so it will look like this
user posted image

3. Now we have to attach a variable with this input box. For that we
will click on the input box and in its Properties tab we will input
the variable name. See the RED rounded rectangle area. The variable
we will is to.
user posted image

4. Now COPY and PASTE this input box and place in front ofFrom,
Subject and Body
so it will look like this
user posted image

now stretct the BODY input box and change its varialbe name and also
from single line to multiple line.
user posted image

5. Now you will have to change the variables names of each INPUT Boxes.
Click on the input box which is in front of From and in its
properties change its variable name to from. Now click
on the input box infront of Subject and change its variable
name to subject. Click in Body input box and change its
variable name to body.

6. Now make a button "SEND" and in its action put the following code.
CODE


  on (release) {

if (to eq "" || from eq"" || subject eq "" || body eq "") {

 getURL("javascript:alert("All fields are required");");

} else {

 send = "done";

 loadVariablesNum("mail.php", 0, "POST");

 getURL("javascript:alert("Your mail has been successfully sent");");

 to="";

       from="";

 subject="";

 body="";

}

   }  

   


7. Now we have to make a check either all the input boxes are filled or
not, for that right click on the first frame of the Layer one and
click on Action.
user posted image
in its action panel paste the following code.
CODE


      stop();

      to="";

      from="";

      subject="";

      body="";

 


Finally the mail form will look like this.
user posted image
[i]All Flash work is done. Now we have to make our PHP code

QUOTE
PHP PART

Now we have to integrate the variables we have made in Flash with PHP
script.  
--------------------------
---- Follow the steps ----
--------------------------

1. Open NOTEPAD or any Text Editor you like.
2. Paste the following code into that
 
CODE


     <?

      if ($send=="done") {

  $to = escapeshellcmd($to);

         $subject = escapeshellcmd($subject);

      $body = escapeshellcmd($body);

      $from = escapeshellcmd($from);

      $tfrom = "From: <$from>";

      mail($to,$subject,$body,$tfrom);

      }

      ?>

   

3. Save this file with name mail.php



QUOTE
Thats all done.  
Now you have to find any webserver thats supports PHP scripts, so that
you can test you Email Sender program. Upload your HTML, SWF and PHP file
in the same folder. Hope it helps.
regards
Ali Roman.

.:: Download Example Files .::



All rights reserved - swish-db.com