Page 1 of 1
Check boxes
Posted: Tue Mar 16, 2004 12:37 pm
by brookside
I have a php page set up to add members to a MySQL Database. I can retrieve all the information from the form except the information in the check boxes. How do I know whether or not a check box has been checked? Can I do this in PHP or do I need to use javascript? I would like to use php if at all possible. Any suggestions or help is appreciated.
Posted: Tue Mar 16, 2004 12:40 pm
by tim
your best bet would create the data in the check boxes into an array. With the data as a array, you can process several items at once
Posted: Tue Mar 16, 2004 12:56 pm
by Bill H
Checkboxes are sort of a "true/false" thing. They return the value if they are checked, but are not even set if they are not checked.
<input type='checkbox' name="Foo' value='Bash'>
on return this will return $_POST['Foo'] = 'Bash' or if not checked, $_POST[''Foo'] will not be set.
Is that what you needed?