RE: [PHP] checkboxes / form elements
| From: | John Holmes | Date: | Sat, 13 Jul 2002 03:35:19 +0000 |
| Subject: | RE: [PHP] checkboxes / form elements | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-107467@lists.php.net to get a copy of this message | ||
> Hello. I have a form that I would like to use checkboxes. these
> checkboxes
> are created dynamically. I've been told that if I want to manipulate
each
> one then I should use 'name=checkbox[]' and make an array out of it.
> okay,
> fine. but how do i access them in my PHP script? I know I have to use
the
> $_POST[] array, but this creates a multidiminsional array, yes? do i
> access
> it like $_POST[checkbox[1]]?? or $_POST[checkbox][1]??
Yes, the second one, only with single quotes.
$_POST['checkbox][1]
Note that arrays start at zero, too.
---John Holmes...