# fix for older versions of PHP. #if (!isset($_GET) && !isset($_POST)) #{ # $_GET = @$HTTP_GET_VARS; # $_POST = @$HTTP_POST_VARS; # $_COOKIE = @$HTTP_COOKIE_VARS; # $_SESSION = @$HTTP_SESSION_VARS; # $_ENV = @$HTTP_ENV_VARS; # $_SERVER = @$HTTP_SERVER_VARS; #} $topdir = "./"; // Don't touch this - go to the configuration part! if (empty($_GET["dir"])) $dir="/"; if (!empty($_GET["dir"])) $dir=$_GET["dir"]; $debug = false; // Display debug messages? $ver="1.2"; #################################################### # START OF CONFIGURATION # # Uncomment one of the $topdir configurations or create one yourself! Default listing is ./ # # Most usefull examples: # $topdir = $_SERVER["DOCUMENT_ROOT"]; // This will display the whole webserver directory. # $topdir = "./"; // Current directory and below. # # Note: # Listing files outside the webserver is possible, # but accessing them with this script is not possible. # # Example: # $topdir = "/"; // Linux root directory - Not recomended! # $topdir = "/home/username/public_html/"; // A specified directory # $topdir = "/home/ftp"; # $topdir = "c:/ftp/"; //win32 envariment? # # # Extra configuration - should not be needed. # $otherlocation = "/path/on/the/web"; //files exist on another location? # $otherlocation = "http://www.server.com/~username/files/"; //files exist on another location? # # ###### # Filter filetypes: $filetypes = array("doc"); # $filetypes = array("gz","zip","php"); # $filetypes = array("inc","bak"); # # $filter = 0; // Only show $filetypes # $filter = 1; // Ignore $filetypes, show the rest. # # END OF CONFIGURATION #################################################### if (!empty($otherlocation)) if ($otherlocation[strlen($otherlocation)-1] != '/') $otherlocation .= '/'; if (empty($otherlocation)) $otherlocation=""; function imgheader() { header("Expires: ".date("D, d M Y H:i:s",mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y")))); } function image_1() { imgheader(); header("Content-type: image/gif"); header("Content-length: 120"); echo base64_decode( 'R0lGODlhEgANAKIAAPf39///zpycAP/OnM7OY////wAAAP//nC'. 'wAAAAAEgANAAADRVglzKYwKgFCOEc8CQX5INE0kWCdqHUQ23Jh'. 'cDyw3RsfA7625g3nM54NA9TRJkOiLlj7LXFMZHE6iC5C2FCrYO'. 'h6v19IAgA7'); } function image_2() { imgheader(); header("Content-type: image/gif"); header("Content-length: 109"); echo base64_decode( 'R0lGODlhEgALAKIAAP///8zMzJmZmWZmZgAAAAAAAAAAAAAAAC'. 'H5BAAAAAAALAAAAAASAAsAAAMyCLrcPjDKyEa4ON9B1HCOwHla'. 'BgliB3yChgZtSk6DeMprAC7wCNi0iUpBKBqPxp2SkQAAOw=='); } function image_3() { imgheader(); header("Content-type: image/gif"); header("Content-length: 54"); echo base64_decode( 'R0lGODlhEgANAIAAAP///wAAACH5BAEAAAAALAAAAAASAA0AAA'. 'INhI+py+0Po5y02ovzKQA7'); } if (empty($_GET["image"])) $image=0; else $image=$_GET["image"]; if ($image == 1) { image_1(); die(); } if ($image == 2) { image_2(); die(); } if ($image == 3) { image_3(); die(); } function f($size="1",$color="#000000",$face="arial") { echo ''."\n"; } function endf() { echo ''."\n"; } function br() { return ''."\n"; } function img($nr,$border=0) { global $_SERVER; return ''; } function getext($filename) { $f = strrev($filename); $ext = substr($f, 0, strpos($f,".")); return strrev($ext); } function sw($i) { if ($i) return 0; else return 1; } function listdir($dir="./",$toplevel="./",$otherlocation="") { global $_SERVER,$debug,$filetypes, $filter; $dir=str_replace('./','/',$dir); $text = ""; if ($dir[strlen($dir)-1] != '/') $dir .= '/'; $path=$toplevel.$dir; $path=str_replace('//','/',$path); $path=str_replace('..','',$path); echo 'You are here: '.$path.''; if ($debug) {f(1); echo br().'$path = '.$path.br().'$dir = '.$dir.br().br(); endf();} $diren=$dir; if (!is_dir("$path")) die(f(2,"#FF0000")."Error $path is not a directory?"); $files = dir($path) or die("Error reading/opening $path"); while ($current = $files->read()) { if (($current != "..") && ($current != ".")) { $dir = $diren; # echo "if (is_dir(".$path.$current."))"; if (is_dir($path.$current)) if ($debug) echo "\$dir = $dir - "; if (is_dir($path.$current)) echo '' .img(1).' '."\n" .'' .$current.''.br(); else { if ($toplevel == "./") $dir = $path; if ($debug) echo "\$dir = $dir - "; $match = sw($filter); if (!empty($filetypes[0])) { $ext=getext($current); $match = $filter; for ($i=0;$i'.$current.''.br(); } } }; } echo "Document Collection"; include("http://www.state.ia.us/educate/includes/head.txt"); echo ""; include("http://www.state.ia.us/educate/includes/navstart.txt"); echo "Document Collection"; echo ""; echo "Scientifically Based Reading Research"; echo ""; echo ""; echo " "; echo ""; echo ''.img(2).' '; echo 'Go to top'.br(); if (empty($topdir)) $topdir = "./"; if ($debug) { f(1); echo "listdir($dir,$topdir,$otherlocation);".br().br(); endf(); } f(2); listdir($dir,$topdir,$otherlocation); endf(); echo ""; echo ""; include("http://www.state.ia.us/educate/includes/navend.txt"); ?>