counter.php dosyanız
<?php
$filename = "hits.txt";
$file = file($filename);
$file = array_unique($file);
$hits = count($file);
echo $hits;
$fd = fopen ($filename , "r");
$fstring = fread ($fd , filesize ($filename));
fclose($fd);
$fd = fopen ($filename , "w");
$fcounted = $fstring."\n".getenv("REMOTE_ADDR");
$fout= fwrite ($fd , $fcounted );
fclose($fd);
?>Saymak istediğiniz sayfanıza eklemeniz gereken kod:
<?php
include ('counter.php');
?>hits.txt isimli bi dosya oluşturun ve CHMOD 777 yapın.