| | |||||||
| |||||||
| |||||||
|
|
|
|
|
|
|
A VERY simple hit counter. By : sethadam1 <?php /* simple_hit_counter steps: 1. create a file hit.txt in the current directory and type a zero as the only character in it. If you want to cheat, instead of a zero, use the number you want to start with. 2. chmod the file to 766. 3. change the value of the variable $startdate below 3. insert this script into your web page where you want the hitcounter to be. */ $startdate = ""; # fill this in with a date at which the hitcounter starts, in ANY format #(ie. 3/15/02; March 15, 2002; or 3.15.2002) if (empty($startdate)) { $startdate = "rollout"; } $currenthits = @file_get_contents("hit.txt"); if($currenthits) { $currenthits++; echo $currenthits." hits since ".$startdate; $fh = @fopen("./hit.txt", "w"); if ($fh) { fwrite($fh, $currenthits); fclose($fh); } } ?>
More Counters Code Articles |
| |
| |