# Complex Flash Form info not passing through whiled embedded a dreamweaver site

**URL:** <https://forum.kirupa.com/t/complex-flash-form-info-not-passing-through-whiled-embedded-a-dreamweaver-site/317440>\
**Category:** Uncategorized\
**Created:** [December 20, 2010, 6:54pm UTC](https://forum.kirupa.com/t/complex-flash-form-info-not-passing-through-whiled-embedded-a-dreamweaver-site/317440 "2010-12-20T18:54:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ksuguy25](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@Ksuguy25](https://forum.kirupa.com/u/Ksuguy25)\
**Post date:** [December 20, 2010, 6:54pm UTC](https://forum.kirupa.com/t/complex-flash-form-info-not-passing-through-whiled-embedded-a-dreamweaver-site/317440/1 "2010-12-20T18:54:33Z")

</div>

Okay, there is something that I don’t quite understand. I built a flash contact form in Flash CS4 and embedded the swf in my webpage using Dreamweaver CS4. I upload the files in my server but why it’s not working? I created a test folder in my folder and it does work…

(It doesn’t work here)  
[http://www.rodriguezstudios.com/atko…g/contact.html](http://www.rodriguezstudios.com/atkostflooring/contact.html)

(But it works here)  
[http://www.rodriguezstudios.com/testat/](http://www.rodriguezstudios.com/testat/)

The problem is that I’m not receiving the information when the user enters and submits the information on the contact form. I do receive the information on the test link. I’m posting the Flash AS and PHP Code to see if anyone can point out any mistake that I’m doing.

```
 Action Script Code:
 submitButton.addEventListener(MouseEvent.MOUSE_UP, sendForm);

```

function sendForm(event:MouseEvent):void {  
if (commentBox.text=="") {

```
    submitMessages.text="You must enter a comment";
} else if (emailBox.text.indexOf("@") == -1 || emailBox.text.indexOf(".") == -1 ) {
    submitMessages.text="You must enter an email address";
} else {
    submitToPHP();
}

```

}

function submitToPHP() {  
if (subject\_text==null) {  
subject\_text==“No Subject provide”;  
}  
var variables:URLVariables = new URLVariables();  
var request:URLRequest = new URLRequest();  
request.url=“atkost-flash.php”;  
request.method=URLRequestMethod.POST;  
request.data = variables;  
variables.name\_text = nameBox.text;  
variables.email\_text = emailBox.text;  
variables.phone\_text = phoneBox.text;  
variables.comment\_text = commentBox.text;//name\_text must match php code  
variables.subject\_text = subject\_text;  
var loader:URLLoader = new URLLoader();  
loader.dataFormat=URLLoaderDataFormat.VARIABLES;  
loader.addEventListener(Event.COMPLETE, completeHandler);  
try {  
loader.load(request);  
submitMessages.text=“Your message is sending to At-Kost Flooring…”;  
} catch (error:Error) {  
submitMessages.text=“Unable to send form”;  
}  
function completeHandler(event:Event):void {  
submitMessages.text=event.target.data.successMessage;  
so.clear();  
nameBox.text="";  
emailBox.text="";  
phoneBox.text="";  
commentBox.text="";  
selectionBox.selectedIndex=-1;  
}

}

```
PHP Code:
 [LEFT] [COLOR=#000000] [COLOR=#0000bb]&lt;?php
                
            
            $emailPattern [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]'/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i'[/COLOR][COLOR=#007700];

          [/COLOR][COLOR=#0000bb]$to [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"fake@email.com"[/COLOR][COLOR=#007700];
        

        [/COLOR][COLOR=#0000bb]$subject [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]'hi'[/COLOR][COLOR=#007700];
        [/COLOR][COLOR=#0000bb]$from [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]'bleh'[/COLOR][COLOR=#007700];
        
        [/COLOR][COLOR=#0000bb]$name_text [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]safe [/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'name_text'[/COLOR][COLOR=#007700]]) );
        [/COLOR][COLOR=#0000bb]$email_text [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]safe[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'email_text'[/COLOR][COLOR=#007700]] );
        [/COLOR][COLOR=#0000bb]$phone_text [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]safe[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'phone_text'[/COLOR][COLOR=#007700]] );
        [/COLOR][COLOR=#0000bb]$subject_text [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]safe[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'subject_text'[/COLOR][COLOR=#007700]] );
        [/COLOR][COLOR=#0000bb]$comment_text [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]safe[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'comment_text'[/COLOR][COLOR=#007700]]) );
        
        
        [/COLOR][COLOR=#0000bb]$headers [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"From: "[/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$from [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]"&lt;" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$to[/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]"&gt;

```

"[/COLOR][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]$headers [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]“Reply-To: " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$email\_text [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]”  
"[/COLOR][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]$headers [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]"Return-path: "[/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$email\_text[/COLOR][COLOR=#007700];

```
          [/COLOR][COLOR=#0000bb]$message [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]"Name: " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$name_text [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]"

```

"[/COLOR][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]$message [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]“Email: " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$email\_text [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]”

"[/COLOR][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]$message [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]“Phone Number: " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$phone\_text [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]”

"[/COLOR][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]$message [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]“Inquiries: " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$subject\_text [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]”

"[/COLOR][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]$message [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]“Comments: " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$comment\_text [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]”

"[/COLOR][COLOR=#007700];

```
        if ([/COLOR][COLOR=#0000bb]count[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$errors[/COLOR][COLOR=#007700]) &lt; [/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]){ 
    [/COLOR][COLOR=#0000bb]mail[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$to[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$subject[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$message[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$headers[/COLOR][COLOR=#007700]);
      echo [/COLOR][COLOR=#dd0000]"var1=yes&successMessage=Thank you so much for your Inquiry. I'm looking forward in serving you soon!"[/COLOR][COLOR=#007700]; 

function [/COLOR][COLOR=#0000bb]safe[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$string[/COLOR][COLOR=#007700]) 
{ 
    [/COLOR][COLOR=#007700]
    return [/COLOR][COLOR=#0000bb]preg_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$pattern[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$string[/COLOR][COLOR=#007700]); 
}

      [/COLOR][COLOR=#0000bb]?&gt;[/COLOR] [/COLOR] [/LEFT]

```

What am I doing wrong? Much Appreciated in advanced!
