Page 1 of 1

simple checkbox / $_GET question

Posted: Tue Jan 20, 2009 2:45 pm
by iG9
I'm trying to let people check multiple items that are being retrieved from a database to generate checkboxes. All the checkboxes have the same name. They are passed back along with other form data to the same page for processing. So now in the URL there are potentially multiple instances of the same variable=value, with different values. If the script wants to do a certain action on each variable, how does it tell them apart, or even see more than one as it seems it would just go with whatever value was passed last?

Re: simple checkbox / $_GET question

Posted: Tue Jan 20, 2009 2:50 pm
by Burrito
you need to create the checkbox as an array

Code: Select all

 
<input type="checkbox" name="myCheck[]">
 

Re: simple checkbox / $_GET question

Posted: Tue Jan 20, 2009 3:09 pm
by iG9
Thanks.