Hi, I was wondering if it was possible to "get" how many files there are in a folder?
There will be 59 files in one directory. Then the php code would say:
There are 59 tutorials. View
Where the View is I want to put in a link, that goes to that folder.
Okay, it works. I was testing it on my home server before I uploaded it onto Frihost. I guess Xampp doesn't have Save Mode Off?
this script will list all files in a directory and can even list directories if u want to..........
// This is the directory to list files for.
$theDirectory = ".";
// Do you want to show directories? change to false to hide directories.
$listDirectories = true;
$dir = opendir($theDirectory);
while(false !== ($file = readdir($dir)))
$type = filetype($theDirectory ."/". $file);
if($listDirectories || $type != "dir")
echo "<tr><td>" . $file . "</td>";
echo "<td>" . $type . "</td>";
if($type == "file")
echo $theDirectory . " is not a directory";