Hi, if anyone could help me with a file listing script that should show the file size together with its date?
http://www.ajdcolour.com/base/user/project/dir_list.php (my project that is not working...)
can anyone see why the file size and date are not showing?
the source is as follows:
<?
echo "<a href='$PHP_SELF?show=1'>Show Source</a><br>";
$dir_name = "/home/sites/site46/web/test/";
$dir = opendir ($dir_name);
echo "<table width='400'><tr><td>";
while ($file_name = readdir($dir)) {
if (($file_name != ".") && ($file_name != "..")) {
echo "<table width='100%'>
<tr>
<td width='33%'>$file_name</td>
<td width='33%'>" . filesize ($file_name) . " bytes</td>
<td width='33%'>" . date ("Y-m-d", filemtime ($file_name)) . "</td>
</tr>
</table><br>";
}
}
echo "</td></tr></table>";
closedir($dir);
?>