Hi,
I have a bunch of uploaded files in a folder. Now I want to be able to get the names of these files that are stored in the folder using PHP so that can I create direct links to each file from my page. ie can PHP read the names of files from a folder?

Thanks,
Sean

<?php
$dir = ".";

$dh = opendir($dir);

while (($file = readdir($dh)) !== false) {
        echo "<A HREF=\"$file\">$file</A><BR>\n";
}

closedir($dh);
?>
commented: useful post +6
<?php $folder=dir("./textfile");

while($folderEntry=$folder->read())
{
      echo $folderEntry."<br>";
}

$folder->close();
?>