funkdrmr
09-15-2006, 02:54 AM
Hi everyone. I'm making an order form for a friend. Part of the form needs to have options. I would like to use either radial buttons or a ComboBox with the options in it.
As the following code stands, I can send email from this form using my sendmail.php file just fine. I just can't for the life of me figure out how to add radial buttons or a ComboBox into the form and pass the variables through.
Here's the code from my flash form:
on (release) {
// Now import the variables we
// need to send in this movie clip
sender_mail = _root.Semail.text
sender_name = _root.Sname.text
sender_subject = _root.Ssubject.text
sender_message = _root.Smessage.text
sender_company = _root.Scompany.text
sender_quantity = _root.Squantity.text
sender_size = _root.Ssize.text
// all the vars we just imported
// will be sent via POST method now
loadVariables("sendmail.php",this,"POST");
// and when receives the answer from
// the server...
this.onData = function()
{
for(var a in this) trace([a,this[a]])
// ok, next frame
_root.nextFrame();
if(this.output=='sent')
{
// in case of success
_root.errTitle = 'Thank You.';
_root.errType = "Your message has been succesfully sent.";
} else {
// else
_root.errTitle = "Error!";
_root.errType = "Attention, an error occurred while processing your message. Please try again later.";
}
}
}
Here is the code from my sendmail.php file:
<?
if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_company']) || !empty($HTTP_POST_VARS['sender_quantity']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_size']) || !empty($HTTP_POST_VARS['sender_subject']) || !empty($HTTP_POST_VARS['sender_name']))
{
$to = "myaddress@email.com";
$subject = "A new order has been submitted!";
$body .= "The following order has been placed from your website." . "\n";
$body .= "\n\n---------------------------\n";
$body .= "Name: " . $HTTP_POST_VARS['sender_name'] . "\n";
$body .= "Company: " . $HTTP_POST_VARS['sender_company'] . "\n";
$body .= "Email: " . $HTTP_POST_VARS['sender_mail'] . "\n";
$body .= "Quantity: " . $HTTP_POST_VARS['sender_quantity'] . "\n";
$body .= "Size: " . $HTTP_POST_VARS['sender_size'] . "\n";
$body .= "Comments: " . $HTTP_POST_VARS['sender_message'] . "\n";
$body .= "\n\n---------------------------\n";
$header = "From: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "Reply-To: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "X-Mailer: PHP/" . phpversion() . "\n";
$header .= "X-Priority: 1";
if(@mail($to, $subject, $body, $header))
{
echo "output=sent";
} else {
echo "output=error";
}
} else {
echo "output=error";
}
?>
Any help with adding 3 radial buttons or a combobox with 3 options to this would be greatly appreciated!
As the following code stands, I can send email from this form using my sendmail.php file just fine. I just can't for the life of me figure out how to add radial buttons or a ComboBox into the form and pass the variables through.
Here's the code from my flash form:
on (release) {
// Now import the variables we
// need to send in this movie clip
sender_mail = _root.Semail.text
sender_name = _root.Sname.text
sender_subject = _root.Ssubject.text
sender_message = _root.Smessage.text
sender_company = _root.Scompany.text
sender_quantity = _root.Squantity.text
sender_size = _root.Ssize.text
// all the vars we just imported
// will be sent via POST method now
loadVariables("sendmail.php",this,"POST");
// and when receives the answer from
// the server...
this.onData = function()
{
for(var a in this) trace([a,this[a]])
// ok, next frame
_root.nextFrame();
if(this.output=='sent')
{
// in case of success
_root.errTitle = 'Thank You.';
_root.errType = "Your message has been succesfully sent.";
} else {
// else
_root.errTitle = "Error!";
_root.errType = "Attention, an error occurred while processing your message. Please try again later.";
}
}
}
Here is the code from my sendmail.php file:
<?
if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_company']) || !empty($HTTP_POST_VARS['sender_quantity']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_size']) || !empty($HTTP_POST_VARS['sender_subject']) || !empty($HTTP_POST_VARS['sender_name']))
{
$to = "myaddress@email.com";
$subject = "A new order has been submitted!";
$body .= "The following order has been placed from your website." . "\n";
$body .= "\n\n---------------------------\n";
$body .= "Name: " . $HTTP_POST_VARS['sender_name'] . "\n";
$body .= "Company: " . $HTTP_POST_VARS['sender_company'] . "\n";
$body .= "Email: " . $HTTP_POST_VARS['sender_mail'] . "\n";
$body .= "Quantity: " . $HTTP_POST_VARS['sender_quantity'] . "\n";
$body .= "Size: " . $HTTP_POST_VARS['sender_size'] . "\n";
$body .= "Comments: " . $HTTP_POST_VARS['sender_message'] . "\n";
$body .= "\n\n---------------------------\n";
$header = "From: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "Reply-To: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "X-Mailer: PHP/" . phpversion() . "\n";
$header .= "X-Priority: 1";
if(@mail($to, $subject, $body, $header))
{
echo "output=sent";
} else {
echo "output=error";
}
} else {
echo "output=error";
}
?>
Any help with adding 3 radial buttons or a combobox with 3 options to this would be greatly appreciated!