"; while (!feof($file)) { $zeile = fgets($file, 4096); print htmlentities($line,ENT_QUOTES); } print ""; fclose($file); exit; } //If path, show directory list print "
Content of $path

"; $dir = opendir($path); while($file = readdir($dir)) { $filepath = $path . "/" . $file; if(is_dir($filepath)) print "[DIR ] "; elseif(is_file($filepath)) print "[FILE] "; elseif(is_link($filepath)) print "[LINK] "; else print " "; if($file == ".") print ".
"; elseif($file == "..") { if(substr($path,0,strrpos($path,"/")) == "") { print "..
"; } else { print "..
"; } } else { print "$file"; // list file attributes $mode = (is_writeable($filepath)) ? ", mode: writeable " : ""; $stat = stat($filepath); $uid = $stat[4]; $gid = $stat[5]; $size = $stat[7]; print " [ uid: $uid, gid: $gid, size: $size $mode]"; } } closedir($dir); print "
"; } else { ?>
Directory?