<html>
<head>
 <title>Index Page</title>
</head>

<body>
<?php
if ($handle=opendir('.')) {
   while ($file = readdir($handle))
   {
      $polozky[count($polozky)] = $file;
   }
   closedir($handle);
   sort($polozky);
}

reset($polozky);
while (list($key, $val) = each($polozky))
{
   if ($val != "." && $val != "..")
   {
      if (is_dir($val))
      {
         echo "(DIR) ";
         echo "<a href=\"$val\">$val</a><br>\n";
      }
   }
}
echo "<br>\n";
reset($polozky);
while (list($key, $val) = each($polozky))
{
   if ($val != "." && $val != "..")
   {
      if (!is_dir($val))
      {
         echo "<a href=\"$val\">$val</a><br>\n";
      }
   }
}
?>
</body>
</html>
