<? 
$filename = "count.txt";
$fp=fopen("$filename","r");
$count=fread($fp, filesize("$filename")); 
fclose($fp); 
$count++; 
$fp=fopen("$filename","w+"); 
fwrite($fp,$count); 
fclose($fp); 

// Use this line below if you like to use this counter to count hits in a PHP file.
//echo "This page has been visited $count times."; 

// Use this line if you like to use this counter to count hits in a HTML file. You also need to add a code in  your HTML file. See the guide for details.
echo "document.write('$count');";
?>  
