A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11337 Flash Movies | 1 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 5828 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.


Random Links | Add your own Flash Related Links
Flash Tutorials 1280 Tutorials 7 New Tutorials Added!
What's New | Top100

» Make a Flash Slide Show Screen Saver
» Simple flash making tutorial for thanksgiving
» Create flash banner for website
» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» Unknown Tag: Title10
Random Tutorial | Add Site

Sr Instructional Designer D2L-Moodle,Clearance
WSI Nationwide, Inc.
US-NJ-Fort Monmouth

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Dynamic_Content

Categories E-mail in Flash the Easy way
Author: Jeffrey F. Hill | Website: http://www.flash-db.com |

 
Page 5
«prev 1 2 3 4 5 6 7 8 next»

Part II - Setting up the server scripts

 Note: I have included three options in this tutorial - PHP, Perl, and ASP - You only need to use one.  This mainly depends on what type of server that you are using, and what is available on that server.  For Unix/Apache based servers, the Perl and PHP ones will work - with Perl being a little more universal.  For win NT/2000 servers the ASP and Perl scripts will work - some modifications will have to be made to the Perl script however.  To find out what type of server you are using and what scripting languages you have available for use, either view the documentation provided by your host, or call your server's tech support.  

One thing to remember is that these script examples were written as educational examples, with simplicity and ease of use in mind.  They all work and can be immediately used, but extra security precautions should be taken if you are planning to use these scripts extensively on a public website, and have any reason to believe that someone would take advantage of them.  

Option 1 - Setting up the PHP Script - to send mail with PHP

The PHP option remains my favorite, it is easier to set up then the rest and PHP in general is easier to learn and understand for this type of application (Opinion).  Your server has to have either PHP 3 or 4 installed to be able to use the following. 

The Code is listed below - each line of the code is then discussed.  Line numbers should not be included in the Actual script.   This script is also included with the download.  After you have made any changes, upload the script to the same directory that you will be running the Flash movie that contains the Mail form.  If you have the script in a different directory you will have to change the path in the loadvariables command (Send Mail Button)).  Note: The $ symbol in PHP indicates a scaler variable. 

Note:  The User Entered variables in this case / example are - FirstName, Email, Company, ToComments, HearAbout - These values are from the flash movie.  No special parsing is required in PHP if it receives these variables then they are already set inside the script.  You may also want to add the stripslashes function in this script if you don't want slashes to be added to your output. An example of how to do this would be: $ToComments = stripslashes($ToComments);  
1)  <?
2)  $ToEmail = "jeff@snowvids.com";
3)  $ToName = "Jeff";
4)  $ToSubject = "Example Mail from SendMail Tutorial";
5)  $EmailBody = "Sent By: $FirstName\nSenders Email: $Email\nSenders Company: $Company\n\n
 Message Sent:\n$ToComments\n\nSender Heard About Site From: $HearAbout\n";
6)  $EmailFooter="\nThis message was sent by: $FirstName from $REMOTE_ADDR If you feel that you
 recieved this e-mail by accident please contact us at www.yourSite.com";
7)  $Message = $EmailBody.$EmailFooter;
8)  mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");
9)  Print "_root.Mail.EmailStatus=Complete - Your mail has been sent";
10)  ?>

 Open up the attached script called snowMailPHP.php and follow along - you can use any text editor to make any changes. 

Line 1:  This just indicates the start of a php script.  In some cases it can be <?php or <?php3.

Line 2:  This is one of the most important lines - this contains the e-mail address of the person that you want the message sent to.  In most cases this will be your own e-mail address.  I left it as my own for now - Be sure to change this to Your e-mail address.  

Line 3:  This Line contains the Name of the person that you are sending this E-mail to.  In most cases you will hard code that into the script here, as shown.  You can also set this variable as a hidden variable in the Flash movie.  When you use the 'Post command' in conjunction with this script, the hidden variable will be sent along with the other variable values. 

Line 4:  This Line sets the Subject line of the e-mail that you are sending.  

Line 5:  This line combines the variables that were sent to the script by the 'Post command' when you used load variables from the Flash movie.  This is where you can format the look of your e-mail. 

Line 6:  This adds some additional information to the bottom of the e-mail that you are sending.   You can add any extra info you want here.  Make sure to remember that everything has to be enclosed with " symbols and a ; symbol has to end the line.  Also note that the \n combo adds a return/new line to your e-mail.  

Line 7:  This just combines the variables $EmailBody and $EmailFooter into one variable $Message.  

Line 8:  This line is what actually sends the E-mail.  The php Function Mail is what does the job.  By enclosing the E-mail tags within <> symbols it creates something like a mailto function.  That way the person can respond to the e-mail directly.  

Line 9:  This prints a message back to the flash movie.  In this case it sets the variable EmailStatus contained in the movie clip instance of Mail to a value of " Complete - Your mail has been sent".

Line 10:  This just signifies the end of the PHP code. 

Well those are the basic's of what you need to know to send mail from a form in Flash with PHP.  I hope that wasn't too confusing.

«prev 1 2 3 4 5 6 7 8 next»

» Level Advanced

Added: : 2001-08-27
Rating: 8.79 Votes: 328
Hits: 12937
» Author
No details available.
» Download
Download the files used in this tutorial.
Download (67 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs