<?php
echo  nl2br ("File list: \n");

$path = "uploads/";
$dh = opendir($path);
$i=1;

while (($file = readdir($dh)) !== false) {
    if($file != "." && $file != ".." && $file != "index.php" && $file != ".htaccess" && $file != "error_log" && $file != "cgi-bin") {
        echo "<a href='$path/$file'>$file</a><br /><br />";
        $i++;
    }
}
closedir($dh);
?> 

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<button onclick="window.location.href='index.html';">
    Go Back
</button>