I want to search employee list depend on area name which is selected from dropdown list. I can retrieve names of areas from database into dropdown list from PHP HTML. But now I am confused how to pass selected option in dropdown list to SQL query in PHP. Also I want index numbers of selected options. My code is as follows.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
include 'Connect.php';
$query = "SELECT varAreaName FROM tbArea" ;
$result = mysql_query($query);
echo'<select name="somename">';
echo'<option value="ANY">--ANY--</option>';
while($row = mysql_fetch_assoc( $result )) {
echo '<option value="'.$row['varAreaName'].'">' . $row['varAreaName'] . '</option>';
}
echo '</select>';
?>
</body>
</html>
Also I want the output on same form using Javascript. But I am new in JavaScript. Please help me to sort this out.