Jump to content

Dynamic CheckBoxes


sk1tL1L

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/166990-dynamic-checkboxes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.