try this...
it isn't the nicest implementation.. it doesn't allow going up directory levels... but this shouldn't be to bad to implement (just strip off the last element of the path).
it can be extended easily by elaborating on the file view... just grab file size, modification dates etc and display them. you can also add links to rename/delete/copy stuff... if you need any more help, let me know
as a personal preference i use tables, but frames may be better in this instance if there are a lot of files.
hope it helps
dom
🙂
<head><title><?php echo $path ?></title></head>
<body>
<?php
// Given $path, otherwise default
$path=urldecode($path);
if(!$path) $path="/usr/apache/htdocs";
// Grab the files & dirs
$handle = opendir($path);
while($entry = readdir($handle))
if(is_dir($path."/".$entry)) {
if($entry != "." && $entry != "..") $dirs[] = $entry;
} else {
$files[] = $entry;
}
?>
<table width=100%>
<tr>
<td valign=top width=20%>
<?php
// display dirs
if($dirs)
while(list($key, $value) = each($dirs)) {
$newpath = urlencode($path."/".$value);
print "<a href=$PHP_SELF?path=".$newpath.">$value</a><br>\n";
}
?>
</td><td valign=top width=80%>
<?php
// display files
if($files)
while(list($key, $value) = each($files))
print $value."<br>\n";
?>
</td>
</tr>
</table>
</body>