light-angel Posted July 3, 2008 Share Posted July 3, 2008 i have found this script <?Php // Define our array of allowed $_GET values $pass = array('main','ts','guides','news','hublist'); // If the page is allowed, include it: if (in_array($_GET['page'], $pass)) { include ($_SERVER['DOCUMENT_ROOT'] . 'hubs/' . $_GET['page'] . '.php'); } // This will load the default page: elseif (!isset($_GET['page'])) { include ($_SERVER['DOCUMENT_ROOT'] . '/main.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'); } ?> but when i put thin the link like www.mydomain.com/index.php?p=guides i just keep getting up the main page and the others wont load can some one help me plz Quote Link to comment Share on other sites More sharing options...
ag3nt42 Posted July 3, 2008 Share Posted July 3, 2008 why don't you just use.. if(!(isset($_GET['page']))){$P='';}else{$P=$_GET['page'];} if($P=='guides') { echo("<META http-equiv='refresh' content='0;URL=http://www.mydomain.com/hubs/guides.php'>"); } you could use a switch statement if you have alot of pages.. switch ($P) { guides: echo ("<META http-equiv='refresh' content='0;URL=http://www.mydomain.com/hubs/guides.php'>"); break; //Stop leak into next case. news: echo "Number 2"; break; ts: echo "Number 3"; break; main: echo "Number 4"; } Quote Link to comment Share on other sites More sharing options...
TransmogriBenno Posted July 3, 2008 Share Posted July 3, 2008 1. The URL www.mydomain.com/index.php?p=guides is wrong, p= and page= are not the same thing. 2. Are the files that you want to load in the subdirectory "hubs"? Quote Link to comment Share on other sites More sharing options...
ag3nt42 Posted July 3, 2008 Share Posted July 3, 2008 1. The URL www.mydomain.com/index.php?p=guides is wrong, p= and page= are not the same thing. 2. Are the files that you want to load in the subdirectory "hubs"? ooh good call i did not even notice it was jus p= Quote Link to comment Share on other sites More sharing options...
light-angel Posted July 3, 2008 Author Share Posted July 3, 2008 no all the files for that are in the hubs dir i did try it and get this error Parse error: syntax error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}' in /home/asgards1/www/hubs/index1.php on line 5 Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 3, 2008 Share Posted July 3, 2008 Use what you already have, but go to ?page=guides instead of ?p=guides. Quote Link to comment Share on other sites More sharing options...
light-angel Posted July 3, 2008 Author Share Posted July 3, 2008 thank you for ya help on this 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.