Re: Simple Array question
| From: | Adam Voigt | Date: | Tue, 29 Jul 2003 17:11:51 +0000 |
| Subject: | Re: Simple Array question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157340@lists.php.net to get a copy of this message | ||
I think what you want is:
<input type="checkbox" name="id[]" value="3">
<input type="checkbox" name="id[]" value="4">
Then on your next page, you can just do:
foreach($_POST['id'] AS $row)
echo $row;
Or whatever, and that way you only get what you need.
On Tue, 2003-07-29 at 13:08, Ryan A wrote:
> Hi,
> If i am posting something like this from a form:
> <input type=checkbox name='id[sh1]' value=3>
> <input type=checkbox name='id[sh2]' value=4>
>
> How do i get the value of id[]?
> eg:
> I dont want the "sh1" and "sh2", i just want the "3" and
> "4"
>
> The reason i dont wan the sh1 and sh2 is those are dynamic and will be
> changing, I just need the values (in this case 3 and 4) to do some
> comparasion and assignment operations
>
> Kindly reply.
>
> Thank,
> -Ryan
--
Adam Voigt (adam@cryptocomm.com)
Linux/Unix Network Administrator
The Cryptocomm Group