All pastes #95464 Raw Edit

Miscellany

public text v1 · immutable
#95464 ·published 2006-07-22 01:33 UTC
rendered paste body
<?


$adres = $_GET["adres"];

if(!($dp = opendir("./"))) die ("Cannot open ./");
$dosya_adi = array(); 
while ($dosya = readdir ($dp))
	{
	if(substr($file,0,1) != '.' and $file != "index.php")
		{
		$dosya_adi[] =  $dosya;
		}
	}
$file_count = count ($dosya_adi);
sort ($dosya_adi);


$boyut = round(filesize($dosya)/1024,1);
$limit = 10; 
$sayfa = $_GET["sayfa"]; 
if($sayfa < 1) $sayfa = 1; 
$toplam = count($dosya_adi); 
$kactan = ($sayfa-1) * $limit; 
$kaca = ($kactan+$limit); 
if($kaca > $toplam) $kaca = $toplam;
for($i=$kactan; $i < $kaca; $i++){
echo "<a href=\"$dosya_adi[$i]\">$dosya_adi[$i]  </a>$boyut kb<br/>";
$toplam = $toplam + filesize($dosya);
}
echo" <br/><small>sayfalar:</small>";
for($i=1; 
$i < $toplam / $limit; 
$i++)
{
if($sayfa == $i)
echo "<small>[$i]\n</small>"; 
else
echo "<small><a href=\"index.php?sayfa=$i&amp;adres=$adres\">[$i]</a>\n</small>";
}
echo "<small>";
echo" <br/>bulundu&#287;unuz sayfa:$sayfa<br/>";
echo" <br/>toplam içerik:$toplam<br/>";
echo "</small>"; 
closedir($dp);
?> 
</p>