Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find how many visitors I have on my page at loading time

Status
Not open for further replies.

Ducu

Programmer
Oct 2, 2003
30
RO
How to find how many visitors I have on my page at loading time.
I want to find how many visitors I have on my webpage when the page is loading so I can put this information on it.
Thank you in advance.
Dan C. Nagy
 
use sessions, count the number of active sessions from the db when the page is requested = number of current visitors.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I did some checking on web. The only solution that I found was in Java + JavaScript, to catch the events of creation and of destruction of session. In my webpage I can do fine with the creation of session, but I have no idea how I can catch the destruction of a session. Any suggestions ?

Where is the db with active sessions ? I was looking in the PHP references and I couldn't find anything. Could you be more specific ?


 
It's not hard to catch the creation and destruction of sessions. Although by default PHP handles sessions transparently to your code, you can tell PHP to use your custom scripts in place of the default handling mechanism.

I have, for example, a FAQ (faq434-2037) in this forum which describes how to use your own code to store sessions in a MySQL database rather than PHP's default method of storing them on the server's filesystem.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top