i have created this form by using just components.
here is my actionscript:
frame 1
stop();
resetBtn.onRelease=function(){
onReset();
}
submitBtn.onRelease=function(){
onSubmit();
}
function onReset() {
male.selected = false;
female.selected = false;
country.text = "";
age.setSelectedIndex(0);
urname.text = "";
email.text = "";
}
function onSubmit() {
formData = new LoadVars();
formData.urname = "";
formData.email = "";
formData.age = "";
formData.gender = "";
formData.country = "";
formData.urname = urname.getValue();
formData.email = email.getValue();
formData.age = age.getValue();
formData.gender = genderGroup.getValue();
formData.country = country.getValue();
formData.send("mailform.php", "POST");
gotoAndStop(2);
}
frame 2
stop();
on frame 2 its just a message saying “mail sent”
php script:
<?php
$sendTo = "my_email_here";
$subject = "My new form";
$headers = "From: <" . $_POST["email"] .">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-path: " . $_POST["email"];
$message = $_POST["urname"];
$message .= "
";
$message .= "Country : $country
";
$message .= "Age : $age
";
$message .= "Gender : $gender
";
mail($sendTo, $subject, $message, $headers);
?>
ok.
Problem 1:
When i click the Submit button another browser window open with the php. file (even though the form still send the data…HOW to stop the form opening the php. file in a browser window ???
Problem 2:
When i get the email on the “From” i get “undefined@servername.here” (servername* is my host server)
the subject comes correctly
then on the body i DONT get the “country” and “name”…like this:
undefined
Country : undefined
Age : 15-18
Gender : male
here is my swf:
ui_form.swf