I’m trying to create a dynamic drop down menu that pulls the city name from a database (and automatically updates as I add new cities) and then when selected goes to that city page. The drop down menu works, but when selecting the city nothing happens. Not sure where I’m going wrong. Here’s what I’ve got
<?php mysql_select_db ("db_name");
echo "<select name=database><option value='.'>Select Your City</option>";
$result = mysql_query ("select DISTINCTROW city_head from database order by city_head");
while ($city_head=mysql_fetch_assoc($database)) {
echo "<option value="#CityIDPage">".$city_head[city_head]."</option>\n"; }
echo "</select><p>";
?>
<select>elements to not inherently change the page location when a new option is selected.You can add this functionality – changing the page location to the value of
valuefor the selected option – by adding the following attribute toselect:i.e.,
Note that you must set
valueappropriately for each city; I don’t know your database schema, so I cannot advise you there.