<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<title>Pobieranie plików</title>
</head>
<body>
<div><ul>
<?php
$filesPath = "./downloads/";

function printList($path)
{
  $fd = opendir($path);
  if(!$fd) return false;
  while (($file = readdir($fd)) !== false){
    if(is_dir($path.$file)) continue;
    echo("<li><a href=\"http://localhost/download.php?name=");
    echo("$file\">$file</a></li>");
  }
  closedir($fd);
}
printList($filesPath);

?>
</ul></div>
</body>
</html>
