Re: Web counter question..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try :

<?
session_start();
if ( ! isset($_SESSION['count']) )
{
  $fp=fopen("./counter.txt","r");
  $_SESSION['count']=fread($fp,5);
  fclose($fp);
  $_SESSION['count']++;
  $cnt=$_SESSION['count'];
  $fp=fopen("./counter.txt","w");
  fwrite($fp,$cnt);
  fclose($fp);
}
$c= $_SESSION['count'];
print "You are visitor no : <b>$c</b><BR>";
?>

Jochem

James Hatridge wrote:
Hi all..

I just put up my stamp bulletin on line (issue #100!!). I have a problem with it. The counter that I use counts everyone every time they look at the site. I want a better counter, can you all suggest one? It's got to work with html and php only.

Thanks,

JIM

PS Check out my stamp bulletin, link below!

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux