I have created a drop down list from a SQL query as follows:
<?php
echo '<form action ="boat_info.php" method="POST">';
$query = "select SHIP_NAME from SHIP";
$result = mysql_query($query, $link);
if (mysql_num_rows($result))
{
echo "<select name='boat' value='bname'>Ship Name: </option>";
while ($row = mysql_fetch_row($result))
{
print("<option value=\"$row[0]\" name =\"bname[]\">$row[0]</option>");
}
}
else
{
print("<option value=\"\">No boats found</option>");
}
echo '<input type="submit" value="Find Cruises!">';
echo '</form>'
?>
And it lists a drop down menu with all the ship names as i had planned. Now i want to be able to click the 'Find Cruises' button which will then take the selected ship from the pull down menu - pass that into a sql query which will then list all the cruises available for that particular boat... is this possible?
IE - how do i get the information about the highlighted option in the pull down --- i have a seperate .php file that deals with the form - but i cannot seem to use $_POST[bname] as a variable!
What am i doing wrong! Thank you!