<?php
$path = getcwd();
$folder1 = opendir($path) or die("Unable to open folder");
while (false !== ($file = readdir($folder1))) {
 if($file == "ind.php")
 continue;
 if($file == "index.html")
 continue;
 if($file == ".")
 continue;
 if($file == "..")
 continue;
 $afile[]=$file;
 rsort($afile);
 $anz=count($afile);
}
closedir($folder1); for($i=0;$i<$anz;$i++)
  {

  $file=$afile[$i];

  echo "<a href='$file>'<img src='$file' alt='$file'></A>";
  }
?>
