<!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>
<?php
$list_file = "downloads.txt";
function printList($list_file)
{
  if(!($fd = fopen($list_file, "r"))){
    return;
  }
  echo "<ul>";
  while (!feof ($fd)){
    $line = trim(fgets($fd));
    $arr = explode(";", $line);
    if(count($arr) == 4){
      echo "<li><a href='download.php?fileid=$arr[0]" .
           "'>$arr[3] ($arr[1])</a> </li>\n";
    }
  }
  echo "</ul>";
}
printList($list_file);
?>
</div>
</body>
</html>