PX : code

Text Counter by David W. Bettis
Download this code


<?php

        
/*
        simple access counter for php3
        (c)1998 David W. Bettis
        dbettis@eyeintegrated.com
        */

$counterFile "/home/httpd/html/counter/counter.text";

function 
displayCounter($counterFile) {
        
$fp     fopen($counterFile,rw);
        
$num    fgets($fp,5);
        
$num    += 1;
        print 
"$num";
        
exec("rm -rf $counterFile");
        
exec("echo $num > $counterFile");
}

if (!
file_exists($counterFile)) {
        
exec("echo 1 > $counterFile");
}
displayCounter($counterFile);

?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.