I have recently learned about DirectoryIntegrator (thanks to this forum) and have read the PHP manual. The code I found as a starter works to list the files.
I then tried to get the list of files and provide a link to the files. That is where my lack of knowledge showed up and I have a RuntimeException with my code.PHP Code:<?php
foreach (new DirectoryIterator('../myfolder') as $fileInfo) {
if($fileInfo->isDot()) continue;
echo $fileInfo->getFilename() . "<br>\n";
}
?>
What am I doing wrong with the echo statement?PHP Code:<?php
foreach (new DirectoryIterator('../myfolder') as $fileInfo) {
if($fileInfo->isDot()) continue;
echo '<a href="/myfolder/' . $fileInfo->getFilename() . ' ">' . $fileInfo->getFilename() . '</a><br> ';
}
?>



Reply With Quote




Bookmarks