<?php
$path = $_SERVER['DOCUMENT_ROOT'].'/'; // dizin yolu, sen yazıcaksın burayı
$handle = opendir($path) or die('dizin açılamadı');
$i = 0;
while(false !== ($file = readdir($handle))) {
if(preg_match('#html#si',$file) and $file != "." and $file != ".." and !is_dir($file)) {
$list[$i][0] = filemtime($file);
$list[$i][1] = $file;
$i++;
}
}
sort($list);
$limit = 100;
$toplam = count($list);
$tsayfa = ceil($toplam/$limit);
$p = intval($_GET['p']);
if($p == '' or $p < 1) $p = 1;
$x = ($p-1)*$limit;
$y = $x+$limit;
if($y > $toplam) $y = $toplam;
closedir($handle);
echo "<ul>\n";
for($i=$x;$i<$y;$i++) {
$tarih = date('d.m.Y - H:i:s',$list[$i][0]);
echo "\t<li><a href=\"$path".$list[$i][1]."\">".$list[$i][1]."</a> - $tarih</li>\n";
}
echo "</ul>\n";
if($tsayfa > 1) {
echo "Sayfalar\t:\n";
for($i=1;$i<=$tsayfa;$i++) {
echo "<a href=\"?p=$i\">$i</a> -\n";
}
}
?>