cturner Posted August 28, 2007 Share Posted August 28, 2007 The code that is below has just given me a 500 internal server error. Can someone please help me solve that error? Can someone also please tell me I can make the code display with syntax highlights? Thanks in advance. require "config.php"; // get the page title from the url $page = $_GET['page']; echo $page; $query1 = mysql_query("SELECT * FROM pages WHERE page_title = '$page'") or die ("Could not query because: ".mysql_error()); while ($row1 = mysql_fetch_array($query1)) { // print the page title from the pages table echo $row['pagetitle']; } // display the javascript menus echo '<script type="text/javascript">'; echo "\nfunction mmLoadMenus() {\n"; echo "<!--"; // display the menuname groups $query2 = mysql_query("SELECT id, count(menuname) as links, pagetitle, subid, submenu FROM menu WHERE menuname != 'Alone' GROUP BY pagetitle") or die ("Could not query because: ".mysql_error()); while ($row2 = mysql_fetch_assoc($query2)) { $page = $row2['pagetitle']; $pagetitle = str_replace('+', '%20', $row2['pagetitle']); $add_menu_item = "addMenuItem(".$row2['pagetitle'].",location=page.php?page=".$row2['pagetitle'].")"; $menu_id = "mm_menu_".$row2['id']; // if submenu = no // then don't display any submenus if ($row['submenu'] == 'No') { echo "if (window.".$menu_id.") return;\n"; echo "window.".$menu_id." = new Menu(\"root\",142,20,\"Verdana, Arial, Helvetica, sans-serif\",10,\"#ffffff\",\"#ffffff\",\"#00397a\",\"#0046c2\",\"left\",\"middle\",3,0,1000,-5,7,true,false,true,0,true,true);\n"; // loop the menu's pagetitles without the submenu echo $menu_id."."."hideOnMouseOut=true;\n"; echo $menu_id."."."menuBorder=0;\n"; echo $menu_id."."."menuItemBorder=0;\n"; echo $menu_id."."."menuLiteBgColor=\'#ffffff\';\n"; echo $menu_id."."."menuBorderBgColor=\'#555555\';\n"; echo $menu_id."."."bgColor=\'#555555\';\n\n"; echo $menu_id.".writeMenus();\n\n"; echo "}"; } else { // submenu = yes // then display the submenus $menu_id2 = "mm_menu_".$row['id']."".$row['subid']; echo "if (window.".$menu_id2.") return;\n"; echo "window.".$menu_id2." = new Menu(\"".$row['pagetitle']."\",142,20,\"Verdana, Arial, Helvetica, sans-serif\",10,\"#ffffff\",\"#ffffff\",\"#00397a\",\"#0046c2\",\"left\",\"middle\",3,0,1000,-5,7,true,false,true,0,true,true);\n"; // loop the menu's pagetitles for the submenu $query3 = mysql_query("SELECT count(menuname) as pages FROM menu") or die ("Could not query because: ".mysql_error()); while ($row3 = mysql_num_rows($query3)) { $add_menu_item2 = "addMenuItem(mm_menu_".$menu_id2."".$subid.","."\"location=\""."\'".$pagetitle."\'\n"; echo $add_menu_item."_".$subid.".addMenuItem(\"".$pagetitle."\",location=\'".$page."\');\n"; echo $menu_id2."_".$subid."."."hideOnMouseOut=true;\n"; echo $menu_id2."_".$subid."."."menuBorder=0;\n"; echo $menu_id2."_".$subid."."."menuItemBorder=0;\n"; echo $menu_id2."_".$subid."."."menuLiteBgColor=\'#ffffff\';\n"; echo $menu_id2."_".$subid."."."menuBorderBgColor=\'#555555\';\n"; echo $menu_id2."_".$subid."."."bgColor=\'#555555\';\n\n"; echo "window.".$menu_id." = new Menu(\"root\",49,20,\"Verdana, Arial, Helvetica, sans-serif\",10,\"#ffffff","#ffffff\",\"#274158\",\"#9c0202\",\"left\",\"middle\",3,0,1000,0,0,true,false,true,0,true,true);"; // loop this for the amount of menus echo $menu_id."".$add_menu_item2; echo $menu_id."."."hideOnMouseOut=true;\n"; echo $menu_id."."."childMenuIcon=\"arrows.gif\";"; echo $menu_id."."."menuBorder=0;\n"; echo $menu_id."."."menuItemBorder=0;\n"; echo $menu_id."."."menuLiteBgColor=\'#ffffff\';\n"; echo $menu_id."."."menuBorderBgColor=\'#555555\';\n"; echo $menu_id."."."bgColor=\'#555555\';\n\n"; } // end of while ($row3 = mysql_num_rows($query3)) { echo $menu_id2.".writeMenus();\n\n"; echo "}\n"; } // end of if ($row['submenu'] == 'No') { } // end of } else { echo "}\n"; Quote Link to comment Share on other sites More sharing options...
fenway Posted August 28, 2007 Share Posted August 28, 2007 Solved how? Quote Link to comment 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.