Akif aşağıdaki kodları deniyebilirsin,

   <?php
////////////////////
$yol = './sayac/';
$ip_adres = $_SERVER['REMOTE_ADDR'];
////////////////////
function sayac_tar($tarih) {
$ktarihi = date("d",$tarih).date("m",$tarih).date("Y",$tarih);
return $ktarihi;
}
function yaz($dosya,$count) {
    global $yol;
    $file = fopen( $yol."$dosya", "w" );
    $count = $count + 1;
    fwrite( $file, $count );
    fclose( $file );
}
function oku($dosya) {
    global $yol;
    $file = @fopen(  $yol."$dosya", "r" );
    $count = @fread( $file, filesize( $yol."$dosya" ) );
    @fclose( $file );
    return $count;
}
function ipkontrol($ip) {
    global $yol;
    $file = @fopen(  $yol."ip-".sayac_tar(mktime()).".php", "r" );
    $liste = @fread( $file, filesize( $yol."ip-".sayac_tar(mktime()).".php" ) );
    @fclose( $file );
if (ereg($ip, $liste)) {
$engelle = 1; } 
else 
{ 
$engelle = 0;  
$file_W = fopen(  $yol."ip-".sayac_tar(mktime()).".php", "a" );
$yaz = $ip."\n";
fwrite( $file_W, $yaz);
fclose( $file_W );
}
return $engelle; }
function sayac() {
    global $ip_adres,$yol;
    $tekil = oku('tekil-'.sayac_tar(mktime()).'.php');
    $dun = mktime()-86400;
    if (file_exists($yol.'tekil-'.sayac_tar($dun).'.php')) {
        $tekil_dun = oku('tekil-'.sayac_tar($dun).'.php');
    } else { 
        $tekil_dun = 'Veri Yok'; }
    $t_tekil = oku('tekil-toplam.php');
    if (ipkontrol($ip_adres)==0) {
    yaz('tekil-'.sayac_tar(mktime()).'.php',$tekil);    
    yaz('tekil-toplam.php',$t_tekil);    
    }
    $sil = mktime()-172800;
    @unlink($yol.'tekil-'.sayac_tar($sil).'.php');
    @unlink($yol.'ip-'.sayac_tar($sil).'.php');
    $rtn = '<table border="0" id="table1" cellspacing="0" cellpadding="0">
		<tr>
			<td>Bugün Tekil : '.$tekil.'</td>
			<td>Dün Tekil : '.$tekil_dun.'</td>
			<td>Toplam Ziyaretçi : '.$t_tekil.'</td>
		</tr>
	</table>';
    return $rtn;
}
echo sayac();
?>