# Rookie checkbox query!

**URL:** <https://forum.kirupa.com/t/rookie-checkbox-query/278427>\
**Category:** programming\
**Created:** [December 29, 2008, 10:10pm UTC](https://forum.kirupa.com/t/rookie-checkbox-query/278427 "2008-12-29T22:10:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![philsbury](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@philsbury](https://forum.kirupa.com/u/philsbury)\
**Post date:** [December 29, 2008, 10:10pm UTC](https://forum.kirupa.com/t/rookie-checkbox-query/278427/1 "2008-12-29T22:10:20Z")

</div>

Hi,  
I’m probably making a really basic error here - I have a sign up form with 3 checkboxes for different opt-outs that look like this:

```auto
<input type="checkbox" id="email_opt" name="email_opt" value="1" /></li>

```

If the user checks it, 1 is passed through the php and posted to the database, but if it’s left blank I get:  
Notice: Undefined index: email\_opt in Sites/mysite/signup.php on line 18

I’m posting it with:

```php
$email_opt = $_POST['email_opt'];

```

I’m assuming as its blank the thing I’m trying to post doesn’t exist, but I can’t see how to fix it.

Any help would be great.

Cheers
