# \[php\] & Flash MX 2004 - problem sending variables on contact form

**URL:** <https://forum.kirupa.com/t/php-flash-mx-2004-problem-sending-variables-on-contact-form/177462>\
**Category:** programming\
**Created:** [February 2, 2006, 3:19am UTC](https://forum.kirupa.com/t/php-flash-mx-2004-problem-sending-variables-on-contact-form/177462 "2006-02-02T03:19:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesse8771](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@jesse8771](https://forum.kirupa.com/u/jesse8771)\
**Post date:** [February 2, 2006, 3:19am UTC](https://forum.kirupa.com/t/php-flash-mx-2004-problem-sending-variables-on-contact-form/177462/1 "2006-02-02T03:19:43Z")

</div>

Hello all,

If anyone could please help I am trying to create a complex contact form using UI2 components. I have a combo box, checkbox, some input fields, and a couple buttons. I have posted the actionscript below to see if anyone can find my issue. I am trying to send the variables to a PHP script I have called “email2.php” stored in my cgi-bin folder. Below is the Actionscript:

stop();  
//COMBO BOX --------------------------------------------------------------  
//default value - first setting from combo box  
var defaultEmailPurpose = “general comment”;  
trace (“You selected general comment.”);  
//setting the selection differences  
myComboBoxListener = new Object();  
myComboBoxListener.change = function(eventObj) {  
var emailPurpose = eventObj.target.selectedItem.label;  
trace ( “You selected “+emailPurpose+”.”);  
}  
myComboBox.addEventListener (“change”, myComboBoxListener);

//CHECK BOX - send copy to me ----------------------------------------  
myLabel.setStyle(“color”, 0x666666);  
myCheckboxListener = new Object();  
myCheckboxListener.click = function() {  
if(myCheckbox.selected) {  
myLabel.text = “You will receive a copy”;  
var visitorCopy = email.text;  
trace(“you will receive a copy”)  
}else{  
myLabel.text = “You will not receive a copy”;  
trace(“you will not receive a copy”)  
}  
}  
myCheckbox.addEventListener(“click”, myCheckboxListener);

//TEXT INPUT -------------------------------------------------------------  
var visitorName = name.text;  
var visitorEmail = email.text;  
var visitorMessage = message.text;

//BUTTON EVENTS -----------------------------------------------------------  
clearBtn.onRelease = function() {  
name.text = “”;  
email.text = “”;  
message.text = “”;  
status\_text.text = “”;  
}  
sendBtn.onRelease = function() {  
if(name.text == “” || email.text == “” || message.text == “” || email.text.indexOf("@") == -1 || email.text.indexOf(".") == -1 ) {  
status\_text.text = “It seems you made a mistake, please go back and correct any errors”;  
}else{  
status\_text.text = “This may take a minute, please only click submit once”;  
this.loadVariables(“[http://www.jsdesignz.net/cgi-bin/email2.php](http://www.jsdesignz.net/cgi-bin/email2.php)”, “POST”);  
}  
}

next we have the PHP… please forgive the errors as this is my second try at PHP:

\<?php  
$sendTo = “[jesse@jsdesignz.net](mailto:jesse@jsdesignz.net)” . $\_POST[“visitorCopy”];  
$subject = "[JSDesignz.net](http://JSDesignz.net) form submission for " . $\_POST[“defaultEmailPurpose”] . $\_POST[“emailPurpose”];  
$headers = "From: " . $\_POST[“visitorName”] . “\<” . $\_POST[“visitorEmail”] . "\>  
";  
$headers .= "Reply-To: " . $\_POST[“visitorEmail”] . "  
";  
$headers .= "Return-Path: " . $\_POST[“visitorEmail”];  
$message = $\_POST[“visitorMessage”];  
mail($sendTo, $subject, $message, $headers);  
?\>

Can anyone help me out please… all help is greatly appreciated.

Thanks,

Jesse

---

<div class="post-metadata">

**Author:** ![cyber007](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@cyber007](https://forum.kirupa.com/u/cyber007)\
**Post date:** [April 12, 2006, 12:46pm UTC](https://forum.kirupa.com/t/php-flash-mx-2004-problem-sending-variables-on-contact-form/177462/2 "2006-04-12T12:46:21Z")

</div>

humm last output is nice in [www.jsdesignz.net](http://www.jsdesignz.net)… do u share with us that form to mail souch… … really nice…
