Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.