javascript - using selected value from dropdown list -


i have html form dropdown list populated php. want user able select option dropdown list , click on "proceed" button open new page based on selected value.

<form name="selectpatient" method="post">             <div align="centre">             <select name="patient_dropdown">             <?php             include "connection.php";              $sql = mysql_query("select name patient_info");             while ($row = mysql_fetch_array($sql))  {             echo "<option value=".$row['name'].">".$row['name']."</option>";             }             ?>             </select>             </div>             <br>             <br>         <input type="submit" name="submit" value="proceed"/>     </form>         <?php         if(isset($_post['submit'])) {     header("location: http://localhost/lei/test.com/proper/specific_patient.php");         }         ?> 

the code above works fine. how selected value dropdown list?? want use selected value run sql query using php other details of patient , call javascript file information. how can that??

thanks in advance !

you need check $_post variables on submit:

  $patient_dropdown = isset($_post['patient_dropdown']) ? $_post['patient_dropdown'] : false; 

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -