Top
Home
<script language="javascript">
function gotoUrl(url) {
 if (url == "")
   return;
 location.href = url;
}</script>
<?php
require_once("wp-config.php");
$moosedb=DB_NAME;
$moosedbuser=DB_USER;
$moosetable=$table_prefix;
$moosetable=$table_prefix ."posts";
$moosepassword=DB_PASSWORD;
$moosehost=DB_HOST;
$conn = mysql_connect("$moosehost", "$moosedbuser", "$moosepassword");
$result=mysql_select_db($dbName,$conn);
$query = "select * FROM $moosetable where post_type like 'page' and post_status like 'publish' order by 'menu_order'" ;
$result= mysql_query($query, $conn) ;
echo "<form>";
echo "<select OnChange=\"gotoUrl(this.options[this.selectedIndex].value)\">";
echo "<option value=\"\" selected=\"selected\">Menu</option>";
while ($r=mysql_fetch_array($result))
{
$post_title=$r["post_title"];
$post_name=$r["post_name"];
$guid=$r["guid"];
echo "<option value=\"$guid\">$post_title";
}
mysql_free_result($result);
?>
</select>
</form>