<script language="JavaScript">
<!--
function winopen(yol,en,boy) {
	newWindow = window.open("","newWindow","width=en,height=boy");
	newWindow.document.open();
	newWindow.document.write('<img src='+yol+' id=resim " alt="">');
	newWindow.document.close();
        window.resizeTo(en,boy);
	newWindow.focus();
}
//-->
</script>
<?php 
# Resimleri cek 
$dizin = "rsmm";//Resminizin Bulunduğu Yolu Yazınız  
$tutucu = opendir($dizin); 
while($dosya = readdir($tutucu)){ 
if(is_file($dizin."/".$dosya)) 
$resim[] = $dosya; 
} 
closedir($tutucu); 

# Ön bilgiler 
$limit = 21; //Bir sayfada gösterilecek resim sayısı  
$sf = $_GET["sf"];  
if($sf < 1) $sf = 1;  
$toplam = count($resim);  

# Bu bilgiler doğrultusunda 
$kactan = ($sf-1) * $limit;  
$kaca = ($kactan+$limit);  
if($kaca > $toplam) $kaca = $toplam; 

# $kactan başlayıp $kaca kadar resim bas 
for($i=$kactan; $i < $kaca; $i++){ 
list($en,$boy,$tur) = get_image_size($dizin."/".$resim[$i]);
echo " 
<a href='".$dizin."/".$resim[$i]."' target='_blank'> 
<img onContextMenu='return false' onclick="winopen('".$dizin."/".$resim[$i]."','".$en."','".$boy."')" src='javascript:void(null)' width='100' height='100' border='0'></a>"; 
} 
echo" </br></br></br>"; 
# Birden başlayıp sayfa sayısı kadar link bas 
for($i=1; $i < $toplam / $limit; $i++){ 
if($sf == $i) 
echo "$in"; else 
echo "<a href='resim.php?sf=$i'>$i</a>n"; 
} 
?>
Denemedim ama