Check boxes
Moderator: General Moderators
Check boxes
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.
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
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?
<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?