elabuwa Posted January 9, 2011 Share Posted January 9, 2011 Hi guys, I have a list box. say the code is <select name="drop1" id="Select1" size="4" multiple="multiple"> <option value="1">item 1</option> <option value="2">item 2</option> <option value="3">item 3</option> <option value="4">item 4</option> <option value="0">All</option> </select> The user will select few items. How do i capture the data through the "POST" method. $data = $_POST['drop']; would not work coz there is an array if data. Can any one help or point me in the right direction? Thanks in advance Quote Link to comment Share on other sites More sharing options...
nderevj Posted January 9, 2011 Share Posted January 9, 2011 A couple of things: 1) Append brackets to your select's name- drop1[]. This will tell PHP to create an array based on the submitted data. 2) Make sure your PHP code references the $_POST element with the same name, minus the brackets- $_POST['drop1']. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.