Hello, i wanna ask you guys if there is anyway i can get the value of a dropdown and pass it to another php file without using the <input type="submit> way?
The way is i have the options in my menu coming from the database
This is my code on the dropdown menu
mysql_connect("localhost", "root" , "");
mysql_select_db("hotelgal");
$query3 = "SELECT suite_code from tblsuite WHERE suite_name = '".$suitename."'";
$result3 = mysql_query($query3);
$row3 = mysql_fetch_assoc($result3);
$suite = $row3['suite_code'];
mysql_connect("localhost", "root" , "");
mysql_select_db("hotelgal");
$queryroom = "SELECT * from tblroom WHERE room_accommodation = '" . $suite . "' AND status = 'AVAILABLE'";
$resultroom = mysql_query($queryroom);
if ($resultroom && mysql_num_rows($resultroom) > 0)
{
echo '<form name = "room" method = "get" action = "reserveupdate.php">';
echo '<select name = "room" id = "rooms">';
while($rows = mysql_fetch_assoc($resultroom))
{
echo '<option>' . $rows['room_no'] . '</option>';
}
echo '</select></form>';
}
i have no problem on this one, the problem is i am trying to select the text of the dropdown and pass it to another php file which have this code
if (isset($_GET['room'])){
$query = "UPDATE tblreserve SET room_no = '" .$_GET['room']. "', status = 'APPROVED' WHERE reservation_code = '" . $reser . "'";
$res = mysql_query($query);
$query2 = "UPDATE tblroom SET status = 'OCCUPIED' WHERE room_no = '" . $_GET['room'] . "'";
$res2 = mysql_query($query2);
echo "<script>alert('Reservee Approved!'); window.location = './adminreserve.php';</script>";
}
i don't want to use the submit for some circumstances, anyone can help?