Re: Accessing form variables
| From: | Miguel Cruz | Date: | Wed, 20 Mar 2002 19:54:21 +0000 |
| Subject: | Re: Accessing form variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-89387@lists.php.net to get a copy of this message | ||
On Wed, 20 Mar 2002, Joshua E Minnie wrote:
> I have a form with a menu which I need multiple select on. How does PHP
> handle this? I have to use $HTTP_POST_VARS["somevariable"] to access
> somevariable from the form.
For a multiple select, stick [] after the HTML name and you'll get it back
as an array with one element for each item the user selects:
<select multiple name="colors[]">
blah blah
</select>
Will get you an array in $_REQUEST['colors'] .
miguel