I have a problem with a particular array in a checkbox input.
$insert .= '<tr>
<td>' .$uname. '</td>
<td>' .$fname. '</td>
<td>' .$lname. '</td>
<td>' .$email. '</td>
<td>'.(($admin == 'y') ? 'Admin':'User').'</td>
<td><input type="checkbox" name="change['.$uid.']"
value="'.(($admin == 'y')?'n':'y').'"/>'
.(($admin == 'y')?'Make a user':'Make an admin user').'</tr>';
From what i've been reading, this should create an array that can be run through if there are multiple checkbox. The $uid is the user id
and the name displays as change[1], change[2] etc.. and this works.
The problem is when i run this through a while statement like so:
while(list($key, $val) = each($_POST['change'])) {
I get this message:
Warning: Variable passed to each() is not an array or object
Does anyone know why this may be happening and how to solve it?