<?php
$fileList = array(); // create array for list of files
$path = "/home/user/public_html_inves/"; // set path to location of files
$dir_handle = @opendir($path) or die ("<option>Unable to open $path</option>");
// Create Directory handle for readdir
while ($file = readdir($dir_handle))
{
function createList($array)
{
foreach(glob as $file)
{
if is_dir(createList($fileList)
else $fileList=$file
}
};
$fileList=""; createList($fileLIst);
}
sort($fileList);
closedir($dir_handle);
foreach($fileList as $fileName)
{
print("<option value=$fileName>$fileName</option>");
}
?>