gettig all values from a multi-selectable listbox

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

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

gettig all values from a multi-selectable listbox

Post by psychotomus »

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>';
}
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: gettig all values from a multi-selectable listbox

Post by Christopher »

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)
Post Reply