PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
psychotomus
Forum Contributor
Posts: 487 Joined: Fri Jul 11, 2003 1:59 am
Post
by psychotomus » Mon Jan 21, 2008 4:32 pm
how I can get all values from a multiple-selectable listbox? What I tried doesn't work.
Code: Select all
if(isset($_POST['Upload']))
{
for($i=0; $i < count($_POST['select']); $i++)
echo $_POST['select'][$i] . '<br>';
}
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Mon Jan 21, 2008 5:53 pm
In the HTML use this syntax to tell PHP to give you the data as an array.
Code: Select all
<select name="myselect[]" multiple="multiple">
(#10850)