tags:

views:

66

answers:

1

I am developing a website using php, mysql, javascript, html, css.
I want to add a counter in this website. I already added a counter in this website, that counter counts every visitor and show total visitors. But my client requirement is different, he wants different counters.

Example:

Online user = 2

Today visitor = 20

Total visitor = 1500

I don’t know how to add (online user and today visitor). Please help me.

I appreciated in advance.

+1  A: 

well, the 'today' user is pretty easy, you can just query all visits since 12:00am today (you ARE putting a timestamp on your visits, right?)

the 'online' would make the assumption that they are at your site for a given period of time. I.E. you could query for visits in the last 3 minutes, and just assume they are still at your site. This is a pretty good 'poor man's online counter'.

EDIT: This is a very generalized approach, not taking into consideration filtering for repeating IP addresses, or doing actual studies to see how long people are actually on your site.

contagious
+1 same thing I would have said.
David Zaslavsky
Thanks everyone, I have completed my required task of counter. (How to add per day and total visitors counter).