sorry about the late reply:
the errors:
Warning: filesize() [function.filesize]: stat failed for ajaxpagefetcher.js in /home/.philadelphia/homer09001/files.dth-scripts.com/listfiles.php on line 12
Warning: filesize() [function.filesize]: stat failed for Anim8or.exe in /home/.philadelphia/homer09001/files.dth-scripts.com/listfiles.php on line 12
the code:
<table border="1"><tr><td>FileName</td><td>File Size</td><td>File Type</td></tr>
<?php
$dirpath = "./files";
$dh = opendir($dirpath);
while (false !== ($file = readdir($dh))) {
if (!is_dir("$dirpath/$file")) {
$filesize = sprintf("%u", filesize($file));
if ($filesize < pow(2,10)){
$totalsize = "$filesize B";
}
if ($filesize >= pow(2,10) && $filesize < pow(2,20)) {
$totalsize = round($filesize / pow(2,10), 2)." KB";
}
if ($filesize >= pow(2,20) && $filesize < pow(2,30)) {
$totalsize = round($filesize / pow(2,20), 2)." MB";
}
if ($filesize > pow(2,30)) {
$totalsize = round($filesize / pow(2,30), 2)." GB";
}
$path_parts = pathinfo($file);
$ext = $path_parts['extension'];
echo "<tr><td>$file</td><td>$totalsize</td><td>$ext<img src=\"fileicons/$ext.png\"></td></tr>";
}}
closedir($dh);
?>