dogru anladiysam;
<?php
//ayar
$desired_extension = 'swf'; //dosya uzantisi
$dirname = "klasor"; //klasor
//ayar
$p = $_GET['p'];
if (empty($p)) { $p = "1"; } //$p boş ise 1 degeri ver
$sayfamiz = $_SERVER['PHP_SELF'];
$dir = opendir($dirname);
$toplam = "1";
while (false != ($file = readdir($dir)))
{
if (($file != ".") and ($file != ".."))
{
$fileChunks = explode(".", $file);
if ($fileChunks[1] == $desired_extension)
{
if ($toplam == $p)
{
echo $file . '</br>';
}
$toplam++;
}
}
}
closedir($dir);
if ($p >= 2)
{
echo "<a href='" . $sayfamiz . "?p=";echo $p - 1;echo "'><< Geri</a> ";
}
if ($p+1 < $toplam)
{
echo "<a href='" . $sayfamiz . "?p=";echo $p + 1;echo "'>İleri >></a>";
}
?>PHP: readdir - Manual
ufak bir kac ekleme ile bu hale geldi, bilmiyorum daha kisa bir yolu varmı