How to get multi select value in drop down
Posted: Sat Apr 23, 2011 9:49 am
i have a drop down combo box with multi select option using check boxes. User can select multiple options by just checking or unchecking the check boxes, when anyone make multiple selection and submit the form, it forwards the values in the url like (page.php?a=1&a=4&a=7&a=9&a=13) the name of the drop down select field is (a), now i want to store all values of my (a) variable into separate fields of database. How to explode the values of the same name variables to store all values 1 by 1 into database?? here is my form code
<form name="memb" action="page.php" method="get">
<select name="a" multiple="multiple" id="a">
<option>Select All</option>
<optgroup label="Group 1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</optgroup>
<optgroup label="Group 1">
<option>6</option>
<option>7</option>
</optgroup>
<optgroup label="Group 3">
<option>8</option>
<option>9</option>
</optgroup>
</select>
<input type="submit" value="Submit">
</form>