Alright, here is a UNIQUE counter I made that requires php. A unique counter only counts how many DIFFERENT users go to your site. In other words, if you have fifty users who clicked on you site two hundred times, it will only show 50.
Alright, first things first. Assuming you have windows, right click on your desktop, and make a new text document. Rename the document to "unique.dat". Alright, make another new text document. Now open up your new text document and paste this into it:
<?php
$filename = "unique.dat";
$file = file($filename);
$file = array_unique($file);
$hits = count($file);
$remote = $_SERVER["REMOTE_ADDR"];
$wholefile = file_get_contents($filename);
if (preg_match("/$remote/i",$wholefile))
{
echo $hits;
}
else
{
$fd = fopen ($filename , "a+");
$fout = fwrite ($fd , "$remote\n");
fclose($fd);
echo $hits;
}
?>Done? Alright, now go back to the desktop, and rename this text document "unique.php". Now upload the two files into your hosting account (whether, it's through cpanel or an ftp application). Set your "unique.dat" to CHMOD 777. You're done. Now, wherever you want the number to be displayed on your site, place this in the html of your php file:
<?php include("unique.php"); ?>It will only display the number so if you want you can also do something like this to display "unique hits = #"unique hits = <?php include("unique.php"); ?>And that's that. I tried to go through step by step, but if you need additional help feel free to ask
[/quote]
Thats a great code, good work.
[/quote]
That's what i was going to say.
Great script... I really appriciate it... i've been using statcounter, though.. good service




