<?php
$directory_name = "dir"; // change this to reflect your directory name
$dh = opendir($directory_name);
while ($file = readdir($dh)) {
if (is_dir("$directory_name/$file")) {
continue;
}
print "<a href=\"$directory_name/$file\">$file</a><br>\n";
}
closedir($dh);
?>
"circuit_breaker" <ci*************@canada.com> wrote in message
news:28**************************@posting.google.c om...
Hi,
I'd like to write a loop that will create a hyperlink on a page for
every single file on a directory. As an example, if my directory
contains:
test.txt
test1.txt
test2.txt,
The page should then contain 3 hyperlinks pointing to these files and
the user just have to click the one he wants to download or read.
Thanks.