PX : code

Simple counter by Istvan Korsos
Download this code


<b>Eddigi látogatók száma, but if you can't read Hungarian, this is the number of the visitors on this page:

<?php
  $counterFile 
"access.text";
  if (
file_exists($counterFile))
  {
   
$fp fopen($counterFile,"r+");
   
$count fgets($fp,5);
   
$count += 1;
   
rewind($fp);
   
fputs($fp,$count,5);
   
fclose($fp);
   print 
"$count";
  }
  else
  {
   
$fp fopen($counterFile,"w");
   
$count "1";
   
fputs($fp,$count,5);
   
fclose($fp);
   print 
"$count";
  }
?>

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.