Hello everyone.
I found this cool little script that shows all the files in a folder and prints the results. It was made to paginate as well, but that doesn't work. I don't care about the pagination, so I have those lines commented out.
In the directory that I have my files in, I have a mixture of files and folders. I would like to hide the folders, so that only the files show up in the list.
Here is the script:
<?PHP
if (!$_GET["start"]) $_GET["start"] = 1;
$show = 10;
$dir = "/path/to/directory";
$thedir = opendir($dir);
while (false !== ($file = readdir($thedir))){
if (in_array($file, array(".", ".."))) continue;
$files[] = $file;
}
$pages = ceil(count($files)/$show);
foreach ($files as $file){
$nr++;
//if ($nr >= $_GET["start"] && $nr < $_GET["start"]+$show){
print "$nr. <a href='$file'>$file</a>";
}
//}
?>
I think this is an easy fix, I'm just new to php.
Thanks.