pietbez Posted April 4, 2012 Share Posted April 4, 2012 Hi, i know this is probably very basic but i have been banging my head and looking for tuts. i have built a mysql php dropdown menu. all displays fine. now, how do i get the menu to actualy take me to a new url? the new url should be www.mysite.com/"menu selection" <? include_once 'includes/db.php'; $result = mysql_query("select * from crimerate WHERE DISTRICT = 'Limpopo'", $con); if (!$result) { die('Invalid query: ' . mysql_error()); } $options=""; while ($row=mysql_fetch_array($result)) { $id=$row["id"]; $crime=$row["CRIME"]; $options.="<OPTION VALUE=\"$id\">$crime</option>"; } ?> <SELECT NAME=crime> <OPTION VALUE=0>Choose <?=$options?> </SELECT> Link to comment https://forums.phpfreaks.com/topic/260322-drop-down-menu/ Share on other sites More sharing options...
Muddy_Funster Posted April 4, 2012 Share Posted April 4, 2012 you will either need to add a submit button to the form or use a javascript/AJAX onChange event handler. You also really should close that first OPTION that you hardcoded into the HTML. Link to comment https://forums.phpfreaks.com/topic/260322-drop-down-menu/#findComment-1334237 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.