Helpful Information
 
 
Category: Post a PHP snippet
Hit Counting

Well... this just won't do. Every site has to have a hit counter snippet. xD I guess I'll have to throw one in. :D


<?php

if (gethostbyaddr($_SERVER['REMOTE_ADDR']) != null) {
$counterDB = "hits.dat";
$hits = file($counterDB);
$current = $hits[0]++;
$handle = fopen($counterDB , "w");
fputs($handle , $current);
fclose($handle);
echo '<b>Hits: '.number_format($current).'</b>';
}

?>










privacy (GDPR)