Simple Hit counter script

Joined
Nov 20, 2010
Messages
37
Reaction score
2
Bellow is an example of a simple hit counter script i wrote for hostwoot.

Code:
<?php
if(file_exists("hits.txt")){
$hits = file_get_contents("hits.txt") + 1;
}else $hits = 1;
$fp = fopen("hits.txt", "w+");
fwrite($fp, $hits); 
fclose($fp);
print $hits; 
?>
 
Back
Top