# Flash Contact Form Problem

**URL:** <https://forum.kirupa.com/t/flash-contact-form-problem/270497>\
**Category:** flash\
**Created:** [September 10, 2008, 3:32pm UTC](https://forum.kirupa.com/t/flash-contact-form-problem/270497 "2008-09-10T15:32:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitster79](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@kitster79](https://forum.kirupa.com/u/kitster79)\
**Post date:** [September 10, 2008, 3:32pm UTC](https://forum.kirupa.com/t/flash-contact-form-problem/270497/1 "2008-09-10T15:32:54Z")

</div>

Hello,

I have created a flash form and I am trying to figure out what mistake I have made in my code as it is not sending the data. Here is my action script and php code below…Can any one help me identify the error and/or how to fix it?

stop();

TEMPty\_mc.\_visible = false;  
fielderror\_mc.\_visible = false;

t=this;  
tfArray = [‘name’,‘email’,‘phone’,‘comments’];

submitBtn.onPress = function() {  
entry=true;  
sendLV = new LoadVars();  
for (var i = 0; i\<tfArray.length; i++) {  
//check fields for entry  
if(t[tfArray\*].text.length\<1) {  
entry=false;  
break;  
}  
sendLV[tfArray\*] = t[tfArray\*].text;  
}

```
sendLV.catalogVia = cstate;
if(entry) {
    //send email request **CHANGE THIS PHP ADDRESS**
    sendLV.sendAndLoad('http://www.1031america.com/email.php',receiveLV,'_POST');
}else{
    //display error message
    fieldError();
}

```

};

receiveLV = new LoadVars();  
receiveLV.onLoad = function() {  
//do whatever: message sent successfully (thank you + info page or something)  
TEMPty\_mc.\_visible = true;  
//in this case I’ve turned off all the text fields and the buttons  
for(var i=0;i\<tfArray.length;i++) {  
t[tfArray\*].\_visible = false;  
}  
submitBtn.enabled=false;  
email\_btn.enabled = false;  
rmail\_btn.enabled = false;  
};

//display error message handling  
var fielderror\_id:Number;

function fieldError() {  
submitBtn.\_visible = false;  
submitBtn.enabled = false;  
fielderror\_mc.\_visible = true;  
clearInterval(fielderror\_id);  
fielderror\_id=setInterval(this, “time”, 3000);  
}

function time() {  
clearInterval(fielderror\_id);  
fielderror\_mc.\_visible = false;  
submitBtn.\_visible = true;  
submitBtn.enabled = true;  
}

PHP code…

\<?php  
//include(“yourClientsConnection.php”);

//the ‘from’ email address should be changed to match the requirements of your client’s server (usually one of the client’s server email addresses)  
$emailHeaders = “From: [info@1031america.com](mailto:info@1031america.com)  
Content-type: text/html”;

$emailBody = “\<b\>1031America Website Contact Form\</b\>\<P\>\</P\>”;  
foreach ($\_POST as $key =\> $value) {  
$emailBody .= “\<b\>”.$key."\</b\>: “.$value.”\<P\>\</P\>";  
}

//this should be your client’s email address  
$emailRecipient = "info@1031america.com";

//change “EMAIL subject” to whatever you want  
$emailSubject = “1031America Website Contact Form”;

mail($emailRecipient, $emailSubject, $emailBody, $emailHeaders);  
?\>
