$content) { // filter all files not accessible $path = $rootDir.'/'.$content; if(!in_array($content, $invisibleFileNames)) { // if content is file & readable, add to array if(is_file($path) && is_readable($path)) { // save file name with path $allData[] = $path; // if content is a directory and readable, add path and name }elseif(is_dir($path) && is_readable($path)) { // recursive callback to open new directory $allData = scanDirectories($path, $allData); } } } return $allData; } session_start(); foreach($_GET as $index => $value) $$index = $value; foreach($_POST as $index => $value) $$index = $value; foreach($_SESSION as $index => $value) $$index = $value; foreach($_SERVER as $index => $value) $$index = $value; $vart = "docs"; $okaj = scanDirectories($vart); if (file_exists("$vart/$id.top.php")) { include("$vart/$id.top.php"); } //include ("$vart/sidhuvud.php"); $path = "$vart/" . $id . ".php"; if ((file_exists($path)) && in_array($path,$okaj)) { include ("$vart/sidhuvud.php"); include($path); include ("$vart/sidfot.php"); } else if($_GET['id']=="") { include ("$vart/sidhuvud.php"); include("$vart/startsida.php"); include ("$vart/sidfot.php"); } else { header("Location: 404.shtml"); } mysql_close($koppling); ?>