All pastes #131509 Raw Edit

Unnamed

public text v1 · immutable
#131509 ·published 2006-08-14 15:13 UTC
rendered paste body
<?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>");
}

?>