All pastes #290068 Raw Edit

Someone

public php v1 · immutable
#290068 ·published 2006-12-23 17:33 UTC
rendered paste body
if(!$_GET["dir"]) {	if (is_dir($base)) {		if ($dh = opendir($base)) {			echo "<pre>";			while (false !== ($file = readdir($dh))) {				if(is_file($base.$file)) {					$link = "?p=dump&amp;file=".$file;				} elseif(is_dir($base.$file)) {					$link = "?p=dump&amp;dir=".$file;				}				$orgf = $file;				if(strlen($file) > 65) {					$file = substr($file, 0, 65);					$file .= "...";				}				echo "<a class='dump' href='{$link}'>"; string_fixed_length_reverse(10, string_fixed_length(70, $file, 1).human_file_size(filesize($base.$orgf)), 1); echo "</a>\n";			}			echo "</pre>";			closedir($dh);		} else {		   msg("Error", "cant open the directory");		}	} else {		msg("Error", "cant find the directory");	}}