sagr wrote:
Yes, I am trying to learn PHP. We use 3rd Party Hit Counters at the moment but they are very fragmented with each website having it's own separate hit counter (and in some cases individual pages having their own counters). I am aiming to organise this chaos and have all our individual websites report their counts to a single central admin website directory so I can, when I gain the skill, do some more detailed overall analysis of visitor patterns across our various websites using just one database.
There's doubtless some standard packages available for this but your desire to create one yourself is laudable.
Something to consider (if you haven't already) would be to use a session cookie within the script so that refreshes from a single visit do not increase the count (unless you want a high count :-)
Brett's Javascript is the best way to do this without changing the counter script, IMHO.
Yes, his suggestion was very helpful (but a little beyond my understanding at the moment).
Basically, what it did was use a JavaScript function to download the output of your counter script then display it. (Once you know that, his code is probably fairly easy to follow.) The functions he used are the basis of AJAX and all sorts of clever web features these days, so worth having seen (even if they are probably overkill for your needs!).
[...] Thanks for that idea which I have now implemented.
No problem, glad to be of assistance.