I have built a pretty basic form in flash that calls a php file. All of the fields function as intended and are returning data except the message box. When I submit a form from the site I get data from; the name, phone number and email address but the data from the message field says undefined. I am using cs3 with actionscript 2.0
Here is my actionscript:
stop();
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
var cbListener:Object = new Object();
var varSubject = “MGDSF Contact”;
cbListener.change = function(evt_obj:Object):Void {
var currentlySelected:Object = evt_obj.target.selectedItem;
varSubject = currentlySelected.label;
};
ddSubject.addItem({data:1, label:“Please select region”});
ddSubject.addItem({data:2, label:“Latin America”});
ddSubject.addItem({data:3, label:“Europe”});
ddSubject.addItem({data:3, label:“Middle East”});
ddSubject.addItem({data:3, label:“Asia Pacific”});
ddSubject.addItem({data:3, label:“Australia”});
ddSubject.addEventListener(“change”, cbListener);
sender.onRelease = function() {
senderLoad.theName = theName.text;
senderLoad.theEmail = theEmail.text;
senderLoad.thePhone = thePhone.text;
senderLoad.theMessage = theMessage.TextArea
senderLoad.theSubject = varSubject;
senderLoad.sendAndLoad(“send2.php”, receiveLoad);
};
receiveLoad.onLoad = function() {
if (this.sentOk) {
gotoAndStop(“success”);
} else {
gotoAndStop(“failed”);
}
};
Here is the php:
<?PHP
$to = "jacobmaloney@comcast.net";
$subject = $_POST[‘theSubject’];
$message = "Name: " . $_POST[‘theName’];
$message .= "
Email: " . $_POST[‘theEmail’];
$message .= "
Phone: " . $_POST[‘thePhone’];
$message .= "
Message: " . $_POST[‘theMessage’];
$headers = “From:~”. $_POST[‘theEmail’];
$headers .= "
Reply-To:". $_POST[‘theEmail’];
$sentOk = mail($to,$subject,$message,$headers);
echo “sentOk=” . $sentOk;
?>
Im sure I’m forgetting something very simple but can’t figure out what that is! Please HELP! Thanks in advance! Please note that the region selections are not being used at the moment, even though the code has been left in…