Re: passing data in a form
| From: | David Otton | Date: | Sun, 20 Apr 2003 11:59:00 +0000 |
| Subject: | Re: passing data in a form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144531@lists.php.net to get a copy of this message | ||
On Sun, 20 Apr 2003 12:30:49 +0100, you wrote:
>However, if I select 2 or more checkboxes, I only get the results of the last option selected.
>
>How can I add a "while there is data in $zone_selected repeat them on the page...."
>sort of thing.
There's a little hack you use to tell PHP there is more than one value
being returned. Put square brackets after your checkbox name, like this:
<input type="checkbox" name="choices[]" value="1"/>
<input type="checkbox" name="choices[]" value="2"/>
<input type="checkbox" name="choices[]" value="3"/>
For the full explanation,
http://www.php.net/manual/en/faq.html.php#faq.html.arrays