Page 1 of 1

gettig all values from a multi-selectable listbox

Posted: Mon Jan 21, 2008 4:32 pm
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>';
}

Re: gettig all values from a multi-selectable listbox

Posted: Mon Jan 21, 2008 5:53 pm
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">