The Arcive of vBulletin Modifications Site. |
|
How do checkboxes work? Details »»
|
|||||||||||||||||||||||||
I can't figure out how checkboxes work. What I want to do is have a list of unique items, each item with a checkbox, so that the user can select whatever items he/she wants. Then he/she clicks a submit button, and whatever items were checked by the user get stored into the database.
How do you write both the HTML for the checkbox, form, and submit button (and whatever else is needed), and the PHP code that figures out which items were checked? Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
First of all, how do you want to store the selections? Does every item have an ID of its own?
|
|
#3
|
||||
|
||||
|
Each item will be the name of a website, and each item's unique ID will be the URL to the website. The URLs for the checked items will get stored in a custom table that has two columns, userid and urls, so the URLs so should be joined together (separated by spaces, for later explosion) and stored in one field.
|
|
#4
|
||||
|
||||
|
Hope this helps.
![]() PHP Code:
|
![]() |
|
|