PDA

View Full Version : Flash 8 form using components and php


mastagolf
01-03-2008, 07:25 PM
I have looked at several tutorials but non seem to get me where i am needing to go to be able to create a form with several text input fields and flash 8 ui components (combo box and radio buttons). Currently, the movie works and the clear button works, but the email that is sent does not have anything except the email/subject and message. I have tried several different ways to get the other stuff to work.

My flash movie has input fields with instance names of(name_box/email_box/address_box/state_box/zip_box/phone_box/message_box) and I am trying to incorporate 2 combo boxes and 3 radio buttons.

On the actions frame of the first frame (I have no clue how to add the components) heres what I have for the test boxes...

stop();

send_btn.onRelease = function() {
my_vars = new LoadVars();
my_vars.name = name_box.text;
my_vars.address = address_box.text;
my_vars.state = state_box.text;
my_vars.zip = zip_box.text;
my_vars.phone = phone_box.text;
my_vars.sender = email_box.text;
my_vars.subject = subject_box.text;
my_vars.message = message_box.text;

if (my_vars.name != "" and my_vars.sender != "" and my_vars.address != "" and my_vars.city != "" and my_vars.state != "" and my_vars.zip != "" and my_vars.phone != "" and my_vars.subject != "" and my_vars.message != "") {
my_vars.sendAndLoad("estimate.php", my_vars, "POST");
gotoAndStop(2);
} else {
error_clip.gotoAndPlay(2);
}
my_vars.onLoad = function() {
gotoAndStop(3);
};
};
name_box.onSetFocus = email_box.onSetFocus = address_box.onSetFocus = city_box.onSetFocus = state_box.onSetFocus = zip_box.onSetFocus = phone_box.onSetFocus =subject_box.onSetFocus=message_box.onSetFocus=fun ction () {
if (error_clip._currentframe != 1) {
error_clip.gotoAndPlay(6);
}
};


For the PHP code I also do not know how to add the components piece but heres what I have:

<?php


$name = stripslashes($name);
$sender = stripslashes($sender);
$address = stripslashes($address);
$state = stripslashes($state);
$city = stripslashes($city);
$zip = stripslashes($zip);
$phone = stripslashes($phone);
$message = stripslashes($message);
$subject = stripslashes($subject);

$subject = "Kilpatrick Lawn Estimate Form ". $subject;


if(isset($message) and isset($name) and isset($address) and isset($city) and isset($state) and isset($zip) and isset($phone) and isset($subject) and isset($sender)){
mail("[email protected]", $subject, $message, "From: $sender");
}
?>

I have posted the source files / php file here for reference...
http://www.kilpatricklawns.com/download.html

Any tutorials out there to help me figure out how to incorporate the components and also add the additional input text boxes?

Thanks in advance for any help.

mojito
01-07-2008, 04:27 PM
First take out your validation, this is just the first step in debugging this, and let us know what that gives.

I cant quickly see the problem but this is complicating things right now, step through the steps, you are trying to get it all to work at once.

Do I understand that you do get something sent to the php script ?

if you send as "get" you can quickly see what is getting sent in the querystring.