Re: Problem of a beginner with Array
| From: | Matt M. | Date: | Wed, 21 Jul 2004 13:52:45 +0000 |
| Subject: | Re: Problem of a beginner with Array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191313@lists.php.net to get a copy of this message | ||
> I would prefer to have if possible:
> input name="Grid1[]" type"checkbox" //1st grid, 1st
> checkbox
> input name="Grid1[]" type"checkbox" //1st grid, 2nd
> checkbox...
>
> That's what Matt M proposed.
> If I do: echo $_POST['Grid1'];
> I have "on" as a result and not a value. I also tried
> with echo $_POST['Grid1[]']; and other similars but I
> have an error message "undefined index", or "array".
output your checkboxes like this:
<input name="Grid1[]" type="checkbox" value="1" />
<input name="Grid1[]" type="checkbox" value="2" />
<input name="Grid1[]" type="checkbox" value="3" />
.
.
.
and so on. Then do a print_r($_POST)