-
Unique Hit Counter
As i sow a lot of sites use hit counter but they use the free ones that advertise for free on your website so i decided to release my script have fun with it and don't forget to give me some like(thanks)
PHP Code:
<?php
$file = "/path/hits_database.txt";
$ip_list = file($file);
$visitors = count($ip_list);
if (in_array($_SERVER['REMOTE_ADDR']."\n", $ip_list))
{
echo "<b>Our Site Hits: </b>: $visitors <br>";
fclose($fp);
} else {
$fp = fopen($file,"a");
fwrite($fp, $_SERVER['REMOTE_ADDR']."\n");
fclose($fp);
$visitors++;
echo "<b>Our Site Hits: </b>: $visitors <br>";
}
?>
:love:
-
Re: Unique Hit Counter
Well, the ones with advertise shows the country of the ppl that acess the website. '-' ... Anyway, I don't like to use that, but you have my thanks :P
-
Re: Unique Hit Counter
You could already google for this really lol, but.. i guess it might be useful to... someone. prehaps.
-
Re: Unique Hit Counter
Well a script like that is sort of well ... basic >.>
-
Re: Unique Hit Counter
You could shorten -
$file = "/path/hits_database.txt";
$ip_list = file($file);
$visitors = count($ip_list);
to
$Visitors = count(file("/path/hits_database.txt"));
Keep it simple :)
-
Re: Unique Hit Counter
i dont use a hit counter i just see how many hits a page has and WOW the amount of ppl that have been to my download page yet i dont see them in the game....... sences leechers and stealers for content