title: Getting a dropdown list populated +sending value back
body: <p>So I was busy with my php and I ran into a problem I populated a dropdown list but how do I get the value back that the user selected?
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  
  echo "Please select the date:";
  echo "&lt;select id=data name=data&gt;";
  for($i = 0; $i &lt; $leng; $i++)
  {
   echo "&lt;option value=$date[$i]&gt;$date[$i]&lt;/option&gt;";
  }
  
  echo"&lt;/select&gt;";
  $selected_key = $_POST['data'];
  $selected_val = $date[$_POST['data']];
  echo $selected_key;
  echo $selected_val;
  mysql_close();
  ?&gt;</code></pre>
  </div>
  </div>
  </p>