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