sk1tL1L Posted July 22, 2009 Share Posted July 22, 2009 Hello PHP Freaks! I am in need of some help, hopefully you guys can give me a hand. What I am trying to do is, create dynamic checkboxes which I have done and then put if they are ticket in a database. My current database layout is setout here: http://img204.imageshack.us/img204/9739/permstable.jpg And this is my form: http://img269.imageshack.us/img269/1186/addpagetable.jpg - the values under the button is the output from: foreach($_POST["perms"] as $value) { $test = explode("|", $value); echo $test['0']."|"; echo $test['1']."<br />"; } And a sample of my html: <td width="12.5%" align="center"><input type="checkbox" name="perms[]" value="5|view"></td> <td width="12.5%" align="center"><input type="checkbox" name="perms[]" value="5|add"></td> <td width="12.5%" align="center"><input type="checkbox" name="perms[]" value="5|edit"></td> <td width="12.5%" align="center"><input type="checkbox" name="perms[]" value="5|delete"></td> the values are: groupid|permission What I need to do is put all those values (ticked or unticked) into the database layout I have but make it so its dynamic as in, if someone adds a new group, i won't have to modify the code. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/166990-dynamic-checkboxes/ Share on other sites More sharing options...
Daniel0 Posted July 22, 2009 Share Posted July 22, 2009 http://www.phpfreaks.com/tutorial/working-with-checkboxes-and-a-database Quote Link to comment https://forums.phpfreaks.com/topic/166990-dynamic-checkboxes/#findComment-880454 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.