make a file called counter.php and include this text:

//-------------------------------------counter.php--------------------------
---------------//

<?php
 //Simple PHP counter, v0.1. Send comments to [EMAIL PROTECTED]
 if (file_exists('count.inc'))
 {
  $fil = fopen('count.inc', r);
  $dat = fread($fil, filesize('count.inc'));
  echo $dat+1;
  fclose($fil);
  $fil = fopen('count.inc', w);
  fwrite($fil, $dat+1);
 }
 else
 {
  $fil = fopen('count.inc', w);
  fwrite($fil, 1);
  echo '1';
  fclose($fil);
 }
php?>

//--------------------------------------------------------------------------
--//


then make a file called count.inc and chmod it to 777 so anyone can write to
it. insert a number into the file.


//------------------------------count.inc-----------------------------------
--//
some value
//--------------------------------------------------------------------------
--//


then all u have to do is include the line:

<?php include (counter.php) ?> into the page you want a counter


hope this helps :) i use this script myself

-Adam



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to