How would that help someone all u would need to go back up a diecty is the ../Originally Posted by leaked
interesting script, as my navigation works by takeing the name then adding an exstention, and a folder on to it, that woulnt work, athogh i may borrow a bit of the script and get the array from the directy commands "/
Heres the code I use on all of my websites, you should use it too (remember to change the array $pages).
If you have 50odd PHP pages you'll have a big *** PHP code, so heres a loop that will go through an array of pages and include them, also exploit safe.
'name' => './path/to/file', etc.
http://somesite.com/?i=name would load up path/to/file
You can change $GET['x'] accordingly ?x=name
PHP Code:<?php
$default = './i/news.php';
$pages = array('about' => './i/about.php','servers' => './i/servers.php','services' => './i/services.php');
if(array_key_exists($_GET['i'], $pages))
{
foreach($pages as $pageid => $pagename) {
if($_GET['i'] == $pageid && file_exists($pagename))
{
include $pagename;
}
}
} else {
include $default;
}
?>








Reply With Quote







