• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Best Script to Count Clicks (Uniques)

MATRIX

Internet Solutions
NLC
Do you know any? :D ... if you have tested one plz tell me , if you can post the Link :p
 
If you have PHP, I'd recommend this for unique user counting:
PHP:
<?
$filename="visitors.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); 
?>
What it will do is obtain the visitor's IP and check if it has been written to visitors.txt yet. If it has, the script will not add to the unique visitors count; if not, it will add the IP to the list so that it will not be counted in the future and it will add to the unique visitors count.

Make sure you create the visitors.txt file and CHMOD it to 777.

Edit: Just read your sig. How 'bout...Esta cosa es solmente para personas muy intelligentes. :D That should make sense if Spanish I taught me anything. :D

Second Edit: Crap. Just noticed the title is "clicks". Mine is used for hits. Sorry. :(
 
Last edited:
Back
Top