# \[PHP\] Check box help!

**URL:** <https://forum.kirupa.com/t/php-check-box-help/178751>\
**Category:** programming\
**Created:** [February 13, 2006, 11:21pm UTC](https://forum.kirupa.com/t/php-check-box-help/178751 "2006-02-13T23:21:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chunk](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@chunk](https://forum.kirupa.com/u/chunk)\
**Post date:** [February 13, 2006, 11:21pm UTC](https://forum.kirupa.com/t/php-check-box-help/178751/1 "2006-02-13T23:21:39Z")

</div>

Hi, I have a checkbox called check:

```auto

<input type="checkbox" name="check" value="1">

```

If it is check, I would like the virable $time to be “afternoon” and if its not checked, the virable to be “morning”.

This is what I have:

```php

if($_POST['check'] == 1) { $time = afternoon} else { $time = morning}

```

This doesn’t seem to work, can anyone enlighten me to where I have gone wrong?
