in reply to Counter of Visits in a HTML page

As a relative newbie, I would think that:

  1. you'd need to be calling a .pl rather than .html
  2. when called the page would have to open a file which includes a current count
  3. increment that value
  4. write value back to file
  5. display that value- either as straight text or use some routine to output graphical equivalents of count
of course the page would have to be displaying all the other content as well.

I know this maybe a good learning exercise, but in real life there are plenty of sites that provide this kind of thing for free

And of course, it may be better to do this through some other solution i.e. javascript (don't know if this would actually be possible)

Replies are listed 'Best First'.
Re: Re: Counter of Visits in a HTML page
by ignatz (Vicar) on Sep 19, 2002 at 18:01 UTC
    > i.e. javascript

    A client-side language wouldn't cut it for something like this. You need something that can maintain state across users and sessions.

    ()-()
     \"/
      `                                                     
    

      OK, bad example there - it would as you say have to be something on server-side.

      And of course, you'd have to be careful of race conditions - i.e. two people viewing the page at the same instant could get the same count unless you were fairly careful - although in this case I guess that's probably not a big worry but it shows how careful you have to be with this kind of stuff