i have created a html page with multiple select list <select name="mylist" MULTIPLE> <option value=1>option 1</option> <option value=2>option 2</option> <option value=3>option 3</option> <option value=4>option 4</option> <option value=5>option 5</option> </select> suppose i select option 1,4,5 when it comes to the backend php, i am able to get only the value of the last selected value ie for option 5... how to process all the seelcted item, please advice
i got the answer! HTML <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <select name="test[]" multiple="multiple"> <option value="one">one</option> <option value="two">two</option> <option value="three">three</option> <option value="four">four</option> <option value="five">five</option> </select> <input type="submit" value="Send" /> </form> PHP <?php $test=$_POST['test']; if ($test){ foreach ($test as $t){echo 'You selected ',$t,'<br />';} } ?>