supermerc Posted February 12, 2008 Share Posted February 12, 2008 Hey, for the first time im using php navigation system for my site, so I dont really know to make it work, but I got this code from a tutorial; <?Php // Define our array of allowed $_GET values $pass = array('test','okay','please'); // If the page is allowed, include it: if (in_array($_GET['page'], $pass)) { include ($_GET['page'] . '.php'); } // This will load the default page: elseif (!isset($_GET['page'])) { include ('home.php'); } // If the page is not allowed, send them to an error page: else { // This send the 404 header header("HTTP/1.0 404 Not Found"); // This includes the error page include ($_SERVER['DOCUMENT_ROOT'] . '/error.php'); } ?> First ill explain how my site is set up maybe that will help you help me, I have a page, that has a table with 3 columns, in the left I have an include statement all my left menues, the center is my main content, and right is an include statement for my right menues. So i have that code in my center box for my content. In the left page that I inlcude, i have my links; <a href="index.php?id=test">test<br /> </a><a href="index.php?id=okay">okay</a><br /> <a href="index.php?id=please">please</a></td> When I load my index.php it sucessfully brings me to home.php so i guess the elseif (!isset($_GET['page'])) { include ('home.php'); } is working. But when I click on the links it doesnt do anything, it like loads home.php again. Please help me, thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/90613-navigation-system-help/ Share on other sites More sharing options...
supermerc Posted February 12, 2008 Author Share Posted February 12, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/90613-navigation-system-help/#findComment-464611 Share on other sites More sharing options...
supermerc Posted February 12, 2008 Author Share Posted February 12, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/90613-navigation-system-help/#findComment-464718 Share on other sites More sharing options...
supermerc Posted February 12, 2008 Author Share Posted February 12, 2008 bump Also I tried a bunch of other naviagation codes and none worked Quote Link to comment https://forums.phpfreaks.com/topic/90613-navigation-system-help/#findComment-465220 Share on other sites More sharing options...
sasa Posted February 12, 2008 Share Posted February 12, 2008 change $_GET['page'] to $_GET['id'] Quote Link to comment https://forums.phpfreaks.com/topic/90613-navigation-system-help/#findComment-465355 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.