Date: 06/06/02
- Next message: Manuel Lemos: "[PHP] Re: Returnpath for mail"
- Previous message: Jay Blanchard: "RE: [PHP] multiple selects and $_POST['vars']"
- In reply to: Chris Knipe: "[PHP] multiple selects and $_POST['vars']"
- Next in thread: Chris Knipe: "Re: [PHP] multiple selects and $_POST['vars']"
- Reply: Chris Knipe: "Re: [PHP] multiple selects and $_POST['vars']"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> <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
- Next message: Manuel Lemos: "[PHP] Re: Returnpath for mail"
- Previous message: Jay Blanchard: "RE: [PHP] multiple selects and $_POST['vars']"
- In reply to: Chris Knipe: "[PHP] multiple selects and $_POST['vars']"
- Next in thread: Chris Knipe: "Re: [PHP] multiple selects and $_POST['vars']"
- Reply: Chris Knipe: "Re: [PHP] multiple selects and $_POST['vars']"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

