function counter( ){
$sFile = 'licznik.txt';
$aFile = file( $sFile );
$sData = $aFile[0];
if( strlen( $sData ) == 0 ){
$sData = 0;
}
if( !isset( $_COOKIE['visited_private'] ) ){
$sData++;
$rFile = fopen( $sFile , 'w' );
fwrite( $rFile, $sData );
fclose( $rFile );
setCookie('visited_private', true, time( ) + 86400 , "/", $SERVER_NAME);
}
return $sData;
}
$ile_wejsc=counter();
?>[/php]
Mam problem z tym licznikiem. Nie wiem jak to sie dzieje, ale ostatnio przy 8 wizytach strony (wg stat24) licznik nabil sie o okolo 1500