CheckBox Flash & PHP

Hi all, :slight_smile:

I’ve created an email input form in Flash, with the fields ‘name’, ‘email’ and ‘message’, and I’m using this code on the submit button to send it via PHP:

on (release) {
		// logical operator checks length. IndexOf checks for "@" and "." characters in e-mail
		if (!name.length) {
				results = "Enter your name.";
 
} else if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
				results = "Check your e-mail.";
		} else if (!song.length) {
				results = "Favorite song?";
} else if (!subject.length) {
				results = "Title your comments.";
} else if (!message.length) {
				results = "Enter your comments.";
		} else {
				loadVariablesNum ("form.php", 0, "POST");
 
		}
}

And this code in the PHP:

<?php
$to = "Your Email"; 
$msg = "$name

";
$msg .= "$message

";
 
mail($to, $subject, $msg, "From: Contact at website <$email>");
 
 
$body2 = "If you want to use a confirmation email put it here.";
 
$subject2 = "Your Site - form submission confirmation ";
$header = "From: Whatever <you@blah.net>
";
 
mail($email, $subject2, $body2, $header);
 
?>

Now I want to add a checkBox (which is part of Flash MXs components) and make it so if the checkbox isn’t checked, then the email won’t send.

I’m sure it’s a simple thing to do, but, while I can post information from text fields, I have no idea what code to put on the submit button, or in the PHP file (I’m sure it’s an ‘IF’ command though).

Can anybody help?

Thanks! :smiley: