# Flash data to php

**URL:** <https://forum.kirupa.com/t/flash-data-to-php/170533>\
**Category:** Uncategorized\
**Created:** [November 27, 2005, 8:39am UTC](https://forum.kirupa.com/t/flash-data-to-php/170533 "2005-11-27T08:39:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![what](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@what](https://forum.kirupa.com/u/what)\
**Post date:** [November 27, 2005, 8:39am UTC](https://forum.kirupa.com/t/flash-data-to-php/170533/1 "2005-11-27T08:39:20Z")

</div>

I have searched through the forums and have not found a way to get my form working. I recieve the email with the titles but the data entered in the text field never shows up. Please take a look and explain what I am doing wrong. I made a simple form that sends data with post to a PHP file in the same directory for emailing me customer entered data from my site. Below are both the flash and the php I used. Any help is appreciated. Thanks,

(flash MX 2004)

stop();

focusManager.defaultPushButton = submit\_btn;

submit\_btn.onRelease = function() {  
var targetLoadVars:LoadVars = new LoadVars();  
var myLoadVars:LoadVars = new LoadVars();  
myLoadVars.title = title\_txt.txt;  
myLoadVars.name = firstname\_txt.txt;  
myLoadVars.lastname = lastname\_txt.txt;  
myLoadVars.maritalStatus = marital\_txt.txt;  
myLoadVars.address = address\_txt.txt;  
myLoadVars.address2 = address2\_txt.txt;  
myLoadVars.city = city\_txt.txt;  
myLoadVars.state = state\_txt.txt;  
myLoadVars.county = county\_txt.txt;  
myLoadVars.zipcode = zip\_txt.txt;  
myLoadVars.homePhone = homenumber\_txt.txt;  
myLoadVars.workPhone = worknumber\_txt.txt;  
myLoadVars.emailFrom = email\_txt.txt;  
myLoadVars.caseStory = case\_txt.txt;  
myLoadVars.emailTo = emailTo\_txt.txt;  
myLoadVars.sendAndLoad("/personal.php",myLoadVars, “POST”);  
targetLoadVars.onLoad = function(){  
trace(this.success);  
};  
gotoAndStop(“thanks”);  
};

(This is the PHP script that I am using)

\<html\>  
\<head\>\<title\>Feedback\</title\>\</head\>  
\<body\>  
\<?php

```
    // Handle POST method.        
    if ($_POST)        
    {            
    $title = $_POST['title_txt'];            
    $firstname = $_POST['firstname_txt'];            
    $lastname = $_POST['lastname_txt'];            
    $maritalStatus = $_POST['maritalStatus_txt'];            
    $address = $_POST['address_txt'];            
    $address2 = $_POST['address2_txt'];            
    $city = $_POST['city_txt'];            
    $state = $_POST['state_txt'];            
    $county = $_POST['county_txt'];            
    $zipcode = $_POST['zipcode_txt'];            
    $homePhone = $_POST['homePhone_txt'];            
    $workPhone = $_POST['workPhone_txt'];            
    $emailFrom = $_POST['emailFrom_txt'];            
    $caseStory = $_POST['caseStory_txt'];            
    $emailTo = $_POST['emailTo_txt'];            
    $comments = $_POST['comments_txt'];            
    $headers = 'From: [email="help@mysite.com"]help@mysite.com[/email]';            
    
    // Compose simple text message:            
    $message = "Message from $firstname ($emailFrom)

                Name: $firstname_txt $lastname_txt 
                Marital: $maritalStatus_txt 
                Address: $address 
                Address2: $address2 
                City: $city 
                State: $state
                County: $county 
                Zip: $zipcode
                Home: $homePhone
                Work: $workPhone
                Email From: $emailFrom
                Case Story: $caseStory
                Email To: $emailTo
                Comments: $comments";            
     $message,$headers);            
    mail("cgelect@bellsouth.net","Feedback", $message,$headers);            
             
    mail($emailto, "Feedback",$message,$headers);            
             
    echo "&lt;h1&gt;Message sent successfully!&lt;/h1&gt;

```

";  
}

```
    else        
    
    {        
    ?&gt;        
    &lt;h1&gt;Feedback&lt;/h1&gt;        
    &lt;form action="&lt;?= $PHP_SELF ?&gt;" method="post"&gt;            
    &lt;p&gt;Title: &lt;input type="text" name="title" /&gt;&lt;/p&gt;                        
    &lt;p&gt;Firstname: &lt;input type="text" name="firstname" /&gt;&lt;/p&gt;                        
    &lt;p&gt;Lastname: &lt;input type="text" name="lastname" /&gt;&lt;/p&gt;                        
    &lt;p&gt;MaritalStatus: &lt;input type="text" name="maritalStatus" /&gt;&lt;/p&gt;                        
    &lt;p&gt;Address: &lt;input type="text" name="address" /&gt;&lt;/p&gt;                        
    &lt;p&gt;Address2: &lt;input type="text" name="address2" /&gt;&lt;/p&gt;                        
    &lt;p&gt;City: &lt;input type="text" name="city" /&gt;&lt;/p&gt;                        
    &lt;p&gt;State: &lt;input type="text" name="state" /&gt;&lt;/p&gt;                        
    &lt;p&gt;County: &lt;input type="text" name="county" /&gt;&lt;/p&gt;                        
    &lt;p&gt;Zipcode: &lt;input type="text" name="zipcode" /&gt;&lt;/p&gt;                        
    &lt;p&gt;HomePhone: &lt;input type="text" name="homePhone" /&gt;&lt;/p&gt;                        
    &lt;p&gt;WorkPhone: &lt;input type="text" name="workPhone" /&gt;&lt;/p&gt;                        
    &lt;p&gt;EmailFrom: &lt;input type="text" name="emailFrom" /&gt;&lt;/p&gt;                        
    &lt;p&gt;CaseStory: &lt;input type="text" name="caseStory" /&gt;&lt;/p&gt;                        
    &lt;p&gt;EmailTo: &lt;input type="text" name="emailTo" /&gt;&lt;/p&gt;            
    &lt;p&gt;Comments:&lt;/p&gt;            
    &lt;p&gt;&lt;textarea name="comments"&gt;&lt;/textarea&gt;&lt;/p&gt;            
    &lt;p&gt;&lt;input type="submit" value="Send!" /&gt;&lt;/p&gt;        
    &lt;/form&gt;        
    &lt;?php        
    }             
    ?&gt;    
    &lt;/body&gt;&lt;/html&gt;
```
