# CheckBox Flash & PHP

**URL:** <https://forum.kirupa.com/t/checkbox-flash-php/81734>\
**Category:** flash\
**Created:** [March 4, 2005, 3:16pm UTC](https://forum.kirupa.com/t/checkbox-flash-php/81734 "2005-03-04T15:16:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unit9](https://avatars.discourse-cdn.com/v4/letter/u/c77e96/32.png) [@Unit9](https://forum.kirupa.com/u/Unit9)\
**Post date:** [March 4, 2005, 3:16pm UTC](https://forum.kirupa.com/t/checkbox-flash-php/81734/1 "2005-03-04T15:16:18Z")

</div>

Hi all, 🙂

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:

```auto
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
<?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! 😃
