tags:

views:

37

answers:

2

I have a text field and two checkbox, i need to list users based on the selection.... can anyone show me an example....

+1  A: 

See:

http://stackoverflow.com/questions/1082152/enumerate-all-check-box-in-php

<input name="rows[]" value="someVal" type="checkbox" />
<input name="rows[]" value="anotherVal" type="checkbox" />

<?php
    // $_POST['rows'] contains the values of all checked checkboxes

    //if something has been checked
    if(isset($_POST['rows'])) {

        //loop over each checked value
        foreach ($_POST['rows'] as $row) {
            echo $row . '<br />';
        }
    }
?>
karim79
Don't forget to test isset($_POST['rows']) in case none are checked
Greg
A: 
if (isset($_POST['mycheckbox']))
{
    draw_selectionCheckboxChecked();
}
else
{
    draw_NoCheckbox();
}
rikh