Please, Help me!!!
I'm creating a form to set menu access level for users.
So, in the first form, you select the user name, it looks at db and shows a serie of check boxes with enables menu options selected.
like:
for($i=0; $i<pg_numrows($result); $i++)
{
$intcodmenu = pg_result($result,$i,intcodmenu);
$vstrnomemenu = pg_result($result,$i,strNomeMenu);
.
.
.
echo("<tr><td> $vstrnomemenu </td><td align=center><input name=access[] type=checkbox CHECKED id=chk$intcodmenu></td></tr>\n")
}
this part works fine, each checkbox has the same name but the ID is chk10, chk20, chk30, etc acording with the menu code, but after the user enable or disable any check box, I need to list checkboxes name and specially ID so I can use this information to update my db.
I'm trying to use foreach, but I'm not able to retrieve the ID of posted elements, just the value:
$i = 1;
foreach($_POST['access'] as $value)
{
echo("$i: $value<br>\n");
$i = $i + 1;
}
exit();
😕