Flash php contact form email results

Posted on 2009-12-19
Last Modified: 2013-11-11
Thanks to Experts Exchange moagrius (guru) I have gotten this far with my flash template php contact form .  It works in that I do get an email from sumitting the form. I get a successfully sent message.  But the email contents do not contain the info ithat was entered n the text fields. The content I get in the email looks like this:

reset_txt   [type Function]
rec   [the email address i put in the ActionScript is repeated here]
serv   php
fields_descriptions   ,t1,your_name,Your Name:,t2,your_email,Your Email:,t3,telephone,Telephone:,t4,message,Message:,t5,field_2,E-mail:,t6,field_3,Address:,t7,field_4,fax:
path   _level0.instance1626

The ActionScript on the submit button is herein code snippet:
Thanks any help!



var fields_descriptions= Array ("", 

									Array("t1", "your_name", "Your Name:"), 

									Array("t2", "your_email", "Your Email:"),

									Array("t3", "telephone", "Telephone:"),

									Array("t4", "message", "Message:"),

									Array("t5", "field_2", "E-mail:"),

									Array("t6", "field_3", "Address:"),

									Array("t7", "field_4", "fax:")


function reset_txt(name,name2,value) {





for (i=1; i<=fields_descriptions.length; i++) {

	reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]);


Open in new window

Question by:vigilence
    LVL 19

    Expert Comment

    the AS in the FLA is crazy - I'd rewrite the contact form part.  Post the PHP mailer and I'll try to make something that works.

    Author Comment

    Thanks.....what is the PHP mailer? :)
    LVL 19

    Expert Comment

    there's a PHP script that sends the mail form - it's named "contact.php" - post the contents

    Author Comment

    Yikes..yes...code snippet attached.  Thanks.:)
    Error_Reporting(E_ALL & ~E_NOTICE);
    $subject="from ".$_REQUEST['Your_Name:'] ;
    $headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
     $headers.='Content-type: text/html; charset=iso-8859-1';
      while ($field = current($_REQUEST)) {
      	if ((key($_REQUEST)!="Your_Name:") && (key($_REQUEST)!="Your_Email:") && (key($_REQUEST)!="Message:") && (key($_REQUEST)!="i")) {
    mail($_REQUEST['recipient'], $subject,  "
     <title>Contact letter</title>
    </html>" , $headers);
    echo ("Your message was successfully sent!");
    	resizeTo(300, 300);

    Open in new window

    LVL 19

    Expert Comment

    this is going to take a little bit and i'm out all day tomorrow - i'll try to get to it tonight, but it might be wednesday...  :/

    Author Comment

    take your time moaqrius....i can't thank you enough!
    LVL 19

    Assisted Solution

    OK - had to make some pretty major changes, and since you have MX (right?) and I can publish for MX, I'll have to give instructions.

    The PHP form is looking for a few key variables, named:

    "Your_Name:" - which I assume is the sender's name, not yours
    "Your_Email:" - again I assumed it was the sender's name
    "recipient" - who the mail's going to - which I thing is supposed to be the one listed at

    So - if that's correct - do this:

    First - click the submit button and remove all the code attached to it - the on(rollover), on(release), everything - just delete it all

    Second - go into the symbol of the submit button - it's called roll_view1 copy 3 - and delete the code from LAYER 1, Frame 1 (it looks like the code you posted) - delete all that

    Third - go back to the main timeline, and click that instance of the submit button again - now give it an instance name of "submitButton"

    Fourth - on frame 179 of the main timeline, on the layer called SCRIPT, remove the code there (again, it looks like the code you posted)

    Fifth - in that same frame (179), paste the snippet below.

    That should do it.

    If you run into more problems, get a copy of Flash 8 somehow and I'll upload the FLA.
    var textFields = [{label:"Name", textField:t1}, {label:"Company", textField:t2}, {label:"Telephone", textField:t3}, {label:"Email", textField:t4}, {label:"Message", textField:t5}];
    function resetText() {
    	for (var i = 0; i<textFields.length; i++) {
    		textFields[i].textField.text = "";
    submitButton.onRollOver = function() {
    submitButton.onRollOut = function() {
    submitButton.onPress = function() {
    	var recipient = "";
    	var messageParts = [];
    	for (var i = 0; i<textFields.length; i++) {
    		var textObject = textFields[i];
    		messageParts[i] = textObject.label+"="+textObject.textField.text;
    	var message = messageParts.join("&");
    	var query = "contact.php?recipient="+recipient+"&Your_Name:="+t1.text+"&Your_Email:="+t4.text+"&"+message;
    	getURL(query, "_blank");

    Open in new window


    Accepted Solution

    Yipee!!!!!  Hoorah!!!!!  THANK YOU moaquris!!!!  Cant thank you enough for staying with me on this.  I'm never going to venture near a Flash template again!!!! Whew!  
    LVL 19

    Expert Comment

    ha!  np - glad it's working for you

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now