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> Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/260322-drop-down-menu/#findComment-1334237 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.