PX : code

Simple PHP Page Counter by Brendan McKenzie
Download this code


<?
        $counter = "/www/htdocs/counter.cnt"; //You may want to change this and 'chown nobody.nobody file' to make it usable. The file must exist for it to work.
        $fd = fopen($counter, "r");
        $num =  fread($fd, filesize( $counter ));
        fclose($fd);
        $fd = fopen($counter, "w");
        $users = $num + 1;
        echo "$users Visitors To This Page";
        fwrite($fd, $users);
        fclose($fd);
?>

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.