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? but work in the link below..
here is a working example i have from:
http://64.4.30.250/cgi-bin/linkrd?lang=EN&lah=8c5cd3d2866b1e770a894c481d89dc16&lat=1006815565&hm__action=http%3a%2f%2fwww%2ecodegoat%2ecom%2ftest%2ephp
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);
?>