title: selected value from the listbox in php
body: <p>I want the value which I select from the <code>listbox</code> and want to store in php variable because I want to use that variable for further use. Please help..</p>
  
  <pre><code>&lt;form name="myform" method="post"&gt;
     &lt;?php
       include('dbconnect.php');
       db_connect();
  
       $query = "SELECT * FROM test_customer"; //Write a query
       $data = mysql_query($query);  //Execute the query
     ?&gt;
     &lt;select id="cust_name" name="mylist" onchange="selectedvalue()"&gt;
     &lt;?php
       while($fetch_options = mysql_fetch_array($data)) { //Loop all the options retrieved from the query
     ?&gt;
     //Added Id for Options Element 
     &lt;option id ="&lt;?php echo $fetch_options['test_id']; ?&gt;"  value="&lt;?php echo   $fetch_options['cust_name']; ?&gt;"&gt;&lt;?php echo $fetch_options['cust_name']; ?&gt;&lt;/option&gt;&lt;!--Echo  out options--&gt;
  
    &lt;?php
      }
    ?&gt;
    &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>