RE: [PHP] POST Arrays with register globals..

2002-06-12 Thread John Holmes
$_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

Re: [PHP] POST Arrays with register globals..

2002-06-12 Thread Analysis & Solutions
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

Re: [PHP] POST Arrays with register globals..

2002-06-12 Thread Mark Heintz PHP Mailing Lists
$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