CheckBox question with php

houssam_ballout

New Member
Hello all,
I am building an application (web),and I am designing a form,using HTML,
I'd checkboxes , I am using isset to enter the data into the database, how can I know if the user has checked or not the checkbox (using checked property), how would I enter that into database?>
I am using the type of that field as binary?
is that correct
Thanks in advance
 
Only checkboxes that have been checked are passed though.
Code:
<input type="checkbox" name="example" value="opt1" /><br />
<input type="checkbox" name="example" value="opt2" />
If both boxes were checked example=opt1 & example=opt2 would be passed so keep in mind if you are using checkbox groupings you may have multiple values for the same control name. If only opt1 was checked only example=opt1 would be passed.

Storing the checked/not checked in a binary (boolean) field is a good way.
 
Back
Top