# If ( ?)

**URL:** <https://forum.kirupa.com/t/if/241095>\
**Category:** Uncategorized\
**Created:** [October 10, 2007, 12:13am UTC](https://forum.kirupa.com/t/if/241095 "2007-10-10T00:13:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/patch/32/1095_2.png) [@Patch](https://forum.kirupa.com/u/Patch)\
**Post date:** [October 10, 2007, 12:13am UTC](https://forum.kirupa.com/t/if/241095/1 "2007-10-10T00:13:06Z")

</div>

Hi, now that I have your attention with the mysterious topic title lol, I need a little help with something.

Basically I am creating a form that sends out emails via addresses from a database table. I also have it so that each email is inserted to a group and each group has a corresponding id/number.

So an example row in my database would be:

id = 1

email = [test@test.com](mailto:test@test.com)

group\_id = 3

pref = HTML

And in my form I have checkboxes which each contact the value/name of the group\_id such “1, 2, 3, 4, 5” etc.

So what I want is so that when the checkbox for group 3 is checked send to the email with the group\_id which is 3?

I have tried various things such as:

```php

if(isset($_POST['submit']) && ($row_email['group_id'] == $_POST['group_id'])){
////something
}

```

Now I know that is not it, I can’t find the actual bit I’m using cuz I’m on a different comp at the moment, but the problem maybe is because I’m using a loop to input the name/value in my checkboxes if that makes any sense?

Plus I haven’t really used checkboxes before, I know there is someting to do with “on” and “true” etc. argh I’m really confused!!! lol. It’s a bit late as I type this, but If no one knows what I mean at the moment, I’ll try and elaborate a bit more later if I can.

Thanks in advanced.
