Web Development Logs
Find articles, news and reviews about latest technologies.


Welcome Guest !
please login or register a new free account.


Home | Archives | Submit Article | Top Rated | Advance Search | Contacts Us | Rss Feeds

    Main Categories
» Free downloads
» General Blog
» Google Adsense
» Scripting languages
» Search Engines
» Web Designing

  More Options
» Most read articles
» Most rated articles

   Subscription
Subscribe now and receive free articles and updates instantly.
» Your name » Your Email

titles description    advance search
Published : April 29, 2006 | Author : Ali Roman
Category : Web Designing | Total Views : 4046 | Rating :

  
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 asinput 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 of From, 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.
 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

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
 
  <?
      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
Thats all done.  

.:: Download Example Files .::

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.




1 2 3 4 5
please rate this article     Poor
Excellent    
Most viewed articles in Web Designing category

How to create web TABS with javascript show-hide layers
Creating email form with flash and php
Embedding flash movie in visual basic
how to load data from a text file in flash
Scrolling externallly loaded text in flash
Most recent articles in Web Designing category

How to create web TABS with javascript show-hide layers
The Resolution Dilemma
Setting best image export quality in flash
Scrolling externallly loaded text in flash
Creating email form with flash and php

 Visitor's Comments !

there are no comments...


    Random Pick
well, I think its enough for today, I have added a couple of oldies but goldies articles which I posted long way back on my community, some of them are still very useful.

    Statistics
» Total Articles
72
» Total Authors
96
» Total Views
116309
» Total categories
6

Delete cookies set by this site | Top   

Article Manager by Flaxweb
Copyright 2006 © Flax Article Manager v1.1