Hi, this has been troubling me for 2 days now. I'm trying to list files and folders etc from a chosen directory. I've been through the forums and used the code given, but it refuses to detect what is a folder and what isn't.
My code is as follows:
$dir1 = $l.":/".$direc;
$dir=opendir($dir1);
while ($file2 = readdir($dir)) {
if ((($file2 != ".") && ($file2 != "..")) && (is_dir($file2))) {
print "DIR <br>";
}
else { ?>
<a href="<?print $l;?>:/<?print $direc;?>/<?print $file2;?>"><?print $file2;?></a><br>
<? }
}
Therefore it should print "DIR" each time it finds a directory, however it's doesn't 🙁
I'm running 4.1.2 on IIS5 under Win XP.