I need to create a drop down box with the categories list of my forum.
How can I redirect the user to the correct page when a selection is made?
This is the attempt i made:
<?php
global $prefix, $user_prefix, $db, $sitename, $bgcolor0, $bgcolor1, $bgcolor2, $bgcolor3, $currentlang;
$content = "";
$content .= "<form name=\"info\">";
$content .= "<select size=\"1\" name=\"categoria\" onChange=\"document.location='modules?name=Forums&file=index&c='+[this.selectedIndex].value;\">";
$result = $db->sql_query("SELECT cat_id, cat_title FROM ".$prefix."_bbcategories ORDER BY cat_id");
while ($row = $db->sql_fetchrow($result))
{
$content .= "<option value='$row[cat_id]'>$row[cat_title]</option>";
}
$content .= "</select></form>";
?>
Thank's for your help... :p