I have a script which reads info from a directory on the server, but what I can't understand is why filesize only shows the info for one file and none of the others. If I delete that file nothing shows at all, the script is listed below if someone could point out what I am doing wrong I would be grateful
Infinity exists! - I just haven't worked out a way to get there yet.
Code:
$handle = opendir('Download');
while (false !== ($file = readdir($handle))) {
//files to ignore
if ($file != "." && $file != ".." && $file != "consultation.doc" && $file != "dir.png" && $file != "size.png" && $file != "type.png" && $file != "req.png"){
//separate filename from file extension
$fsplit=explode(".",$file);
$fname=$fsplit[0];
$fext=$fsplit[1]
//output information
echo "<tr><td>$fname</td><td>$fext</td>";
echo "<td>".filesize($file)." Bytes</td></tr>";
}}
clodedir($handle);
Infinity exists! - I just haven't worked out a way to get there yet.