nunoabc
New Member
- Messages
- 151
- Reaction score
- 0
- Points
- 0
Here's the thing: I want to have a unique hit counter in my page. I found a script but it isn't unique... It stores all IPs from everyone, but if I reload it again, and again, and again it will count. I need a condition to check all IPs and compare to the visitors IP. If it is in the text file then it won't store it, but if isnt there it will store the IP.
I'll pay 200 credits for the PHP script that best fits for me.
PHP:
<?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);
?>