Use glob() function.
$files_in_directory = glob("*.php");
$links = "";
// do some processing
foreach( $files_in_directory as $selected_file){
$name_of_file = basename( $selected_file );
$links .= sprintf("<a href='%s'>%s</a><br />",$selected_file ,$name_of_file);
}
echo $links;
Thats the rough basics of gathering a list of files in a directory and making links to follow.