How to get multiple selected values of select box in php?

Posted by Param-Ganak on Stack Overflow See other posts from Stack Overflow or by Param-Ganak
Published on 2010-03-09T07:27:26Z Indexed on 2010/03/09 7:36 UTC
Read the original article Hit count: 282

Filed under:
|
|

Hi Friends! I have a html form which have a select list box from which you can select multiple values because its multiple property is set to multiple. Consider form method is get method. The html code for form is as follows.

<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="get" action="display.php">
  <table width="300" border="1">
    <tr>
      <td><label>Multiple Selection </label>&nbsp;</td>
      <td><select name="select2" size="3" multiple="multiple" tabindex="1">
        <option value="11">eleven</option>
        <option value="12">twelve</option>
        <option value="13">thirette</option>
        <option value="14">fourteen</option>
        <option value="15">fifteen</option>
        <option value="16">sixteen</option>
        <option value="17">seventeen</option>
        <option value="18">eighteen</option>
        <option value="19">nineteen</option>
        <option value="20">twenty</option>
      </select>
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="Submit" tabindex="2" /></td>
    </tr>
  </table>
</form>
</body>
</html>

I want to display the selected values in select list box on display.php page. So how the selected values are accessed on display.php page using $_GET[] array.

Please reply Friends. Bye. Thank You.

© Stack Overflow or respective owner

Related posts about html

Related posts about php