php form handling multiple select entries
The problem: You need to use the result of a multiple select form element in your php script. Handling a $_POST request gives only one entry from the form element, not all those selected.
The solution: Use array name in form element name ie multiselect becomes multiselect[] or
<select name=”multipleselect[]“>
<option value=”0″>0</option>
<option value=”1″>1</option>
<option value=”2″>2</option>
<option value=”3″>3</option> , etc
then handle with
foreach($_POST['multiselect'] AS $multi) {
// code to deal with each selected item
}
A version of this was found in Using Arrays with Form Data in PHP in PHP 5 Unleashed by John Coggeshall



