PDA

View Full Version : Combo Box and PHP to email


nate51
11-05-2007, 06:58 PM
I have been searching the net like crazy and coming up dry a lot.

I am making a registration form in flash that has input text fields and combo box drop downs.

The input txt fields work perfect, everything typed in is sent to my email after I hit submit.

I am lost on the combo boxes though. The choices I make do not display in my email. I am using Flash CS3 Professional and a lot of the tutorials are for version 8 or lower and some of the choices they make, flash has changed for mine.

If anyone can help me out here I could really use it.

My AS for the submit button is as follows...

on (release) {
_root.register.form.loadVariables("email.php", "POST");
// Initialize formData variables:
_root.register.form.heardabout = "";
_root.register.form.referral = "";
_root.register.form.type = "";
_root.register.form.size = "";
_root.register.form.price = "";
_root.register.form.location = "";
_root.register.form.status = "";
_root.register.form.familystatus = "";
// Gather the order information into a LoadVars instance.
_root.register.form.heardabout = heardabout_cb.getValue();
_root.register.form.referral = referral_cb.getValue();
_root.register.form.type = type_cb.getValue();
_root.register.form.size = size_cb.getValue();
_root.register.form.price = price_cb.getValue();
_root.register.form.location = location_cb.getValue();
_root.register.form.status = status_cb.getValue();
_root.register.form.familystatus = familystatus_cb.getValue();
}

My PHP

<?php

$sendTo = "nathan@ne-media.com";
$subject = "Inquiry/Comment";

$headers = "" . $_POST["firstname"] .",
". $_POST["lastname"] .",
". $_POST["email"] .",
". $_POST["homephone"] .",
". $_POST["businessphone"] .",
". $_POST["addressline1"] .",
". $_POST["suite"] .",
". $_POST["city"] .",
". $_POST["province"] .",
". $_POST["postalcode"] .",
". $_POST["heardabout_cb"] .",
". $_POST["referral_cb"] .",
". $_POST["type_cb"] .",
...etc
...etc
". $_POST["familystatus"] ."";

mail($sendTo, $subject, $headers);

?>

If this way off. I can only say I am very new to this and am slightly lost and am trying everything.

I need help with this, please.

-- Nathan

nate51
11-06-2007, 08:17 PM
I think I have a feeling where things are going wrong.

I have this AS on the first frame in the MC where the combo boxes are

function ComboBox(){
headers = heardabout_cb.getValue();
}

I am running out of ideas and really need help with this, if anyone can help, they would be a life saver.

I am using Flash CS3 professional with AS 2.0 if that helps.

nate51
11-07-2007, 10:26 PM
OK!

I now have the data sending to my email correctly, no more "[type Function]" from the combo boxes.

The issue now though is I have multiple choices in each box but for whatever reason no matter what I choose in each box, my email only recieves the first one option of each box.

Each box only contains Labels I have no "Data" in any of them.