cipher143 Posted March 9, 2013 Share Posted March 9, 2013 (edited) 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! Edited March 9, 2013 by cipher143 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.