title: unable to pass multiple listbox items to php
body: <p>i need to store multiple elements of listbox item into the database , but i am unable to pass the elements from the html form to php. Please help</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="post" action="Save.php"&gt;
      &lt;select name="country[]" multiple="multiple"&gt;
          &lt;option value="Belgium"&gt;Belgium&lt;/option&gt;
          &lt;option value="France"&gt;France&lt;/option&gt;
          &lt;option value="Germany"&gt;Germany&lt;/option&gt;
          &lt;option value="Holland"&gt;Holland&lt;/option&gt;
          &lt;option value="Greece"&gt;Greece&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type="Submit" value="Submit" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
      &lt;?php
  
      if(isset($_POST['submit']))
      {
      $con = $_POST['country'];
      foreach($con as $selected)
      {
      echo 'selected'.$selected;
  
      }
      ?&gt;
  </code></pre>