$_POST['groups'] is an array. It's size is going to be dependant on how
many check boxes were checked.
So, in your example, if only blah2 is selected, you'll have
$_POST['groups'][0] == '2'
You can use count($_POST['groups']) to see how many boxes were checked.
---John Holmes...
> -Origi
Hi Adam:
On Wed, Jun 12, 2002 at 01:15:03PM -0700, Adam Plocher wrote:
> blah3
>
> $groups[] = $_POST['groups[]'];
This is just wrong.
> $groups[] = $_POST['groups'];
This assigns the global groups array to one element in a local groups
array. So, if you then do the following, you'd see
$groups = $_POST['groups'];
or
if(isset($_POST['groups']) && is_array($_POST['groups']))
$groups = $_POST['groups'];
else
$groups = array();
so that groups is an (empty) array even if no checkboxes were checked
mh.
On Wed, 12 Jun 2002, Adam Plocher wrote:
> blah1
> &nbps; blah2
> bl
3 matches
Mail list logo