There are some potential pitfalls involving: CASE 1: Multi user systems: You will see the same IP for all of the users on that system.
CASE 2: Firewalls You might only see the firewalls IP# for each and every user behind it. CASE 3: Dynamically assigned IP# IP# might dynamically be assigned to different user at different times points > -----Original Message----- > From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 29, 2003 2:35 PM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] Re: Counter problems! > > > You could check the IP adress of the visitor. > If it has not changed the the visitor is the same. > Last IP adress in the counter file? > > > Jochem > > Radovan Radic wrote: > > Hi > > > > I want to add simple counter on my index.php page. > > > > counter.php: > > <? > > if (!session_is_registered("counter")) > > { > > $fp=fopen("counter.txt","r"); > > $counter=fread($fp); > > fclose($fp); > > $counter++; > > session_register("counter"); > > } > > print "Visited: $counter<BR>"; > > ?> > > > > index.php > > <? > > session_start(); > > print "Simple page<BR>"; > > include("counter.php"); > > ?> > > > > This should work, but when someone refreshes index.php page, counter is > > increased! How can i stop it? > > > > Thx, > > Radovan > > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php