cipher143 Posted March 9, 2013 Share Posted March 9, 2013 I'm trying to include a checkbox group in a form submission. The user can check one, two, or all three of the choices. I need only the checked boxes to how can i do that? help me with a small example if possible so that i can nderstand well,plzzz. Thank you! Link to comment https://forums.phpfreaks.com/topic/275443-insert-values-from-checkboxes-to-database/ Share on other sites More sharing options...
Barand Posted March 9, 2013 Share Posted March 9, 2013 Give them all the same name which should end with "[]" eg <input type='checkbox' name='box[]' value='1'> Choice 1<br> <input type='checkbox' name='box[]' value='2'> Choice 2<br> The values wil be posted in an array ($_POST['box']). Only checked ones are posted Link to comment https://forums.phpfreaks.com/topic/275443-insert-values-from-checkboxes-to-database/#findComment-1417744 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.