Re: multiple selects and $_POST['vars']
| From: | Chris Knipe | Date: | Thu, 06 Jun 2002 17:49:22 +0000 |
| Subject: | Re: multiple selects and $_POST['vars'] | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100979@lists.php.net to get a copy of this message | ||
Thanks everyone!! Appreciate it
----- Original Message -----
From: "1LT John W. Holmes" <holmes072000@charter.net>
To: "Chris Knipe" <savage@savage.za.org>; <php-general@lists.php.net>
Sent: Thursday, June 06, 2002 7:18 PM
Subject: Re: [PHP] multiple selects and $_POST['vars']
> > <form method="post" action="blah.php">
> > <select multiple name="bleh">
> > <option value="1">1</option>
> > <option value="2">2</option>
> > <option value="3">3</option>
> > <option value="4">4</option>
> > <option value="5">5</option>
> > </select>
> > </form>
>
> <form method="post" action="blah.php">
> <select multiple name="bleh[]">
> <option value="1">1</option>
> <option value="2">2</option>
> <option value="3">3</option>
> <option value="4">4</option>
> <option value="5">5</option>
> </select>
> </form>
>
> Notice the [] on the name, telling PHP it's an array.
>
> Then, to get the items selected, it will be in $_POST['bleh'], which is an
> array. So, $_POST['bleh'][0] will be the first one selected, etc.
> count($_POST['bleh']) will tell you how many were selected.
>
> ---John Holmes...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>