<form action="searchdetail.php" method="post">
SEARCH BY:
<select name="searchby">
<option value="gname">Guest Name</option>
<option value="city">Guest City</option>
</select>
<input name="query" type="text" />
<input name="subval" type="submit" value="Search" />
</form>
and searchdetail.php
include("config.php");
if(isset($_POST['subval']))
{
$query = mysql_real_escape_string(trim($_POST['query']));
$sql = mysql_query ("SELECT * FROM voucher WHERE gname = '$query'");
echo "<table border=1 width=860 align=center cellsapcing=5 cellpadding=5>";
echo "<tr>";
echo "<th>Guest Name</th>";
echo "<th>Guest City</th>";
echo "</tr>";
while ($row = mysql_fetch_array($sql))
{
echo "<tr>";
echo "<td>" . $row['gname'] . "</td>";
echo "<td>" . $row['city'] . "</td>";
echo "</tr>";
}
}
how can i get combobox value from that page. for example if user selects GUEST CITY from combobox and then he types PORT BLAIR in the input text field. then searchdetail.php page should show the PORT BLAIR guests. how can i do that? i'm little bit confused.. before i have done this but i'm using only textbox. But here i want to pass the id of combobox value too.. any help...