Statistics website Total number of people, do not know that everyone has a good way of wood. Ask for advice.
Reply content:
Statistics website Total number of people, do not know that everyone has a good way of wood. Ask for advice.
Database save session, so you can get online people
The number of people who use cookies to save count () expires 5 minutes, which reduces stress.
Once did such a function, say a thought, may compare slag.
Front desk :
In a public page (such as the bottom of the page or the head) to add a $.get, access once, to the background asynchronous commit one, representing the online, submitted data including the current time.
Background
Processing the submitted time, according to the sessionID to determine whether the new user or already exist, and save the data in a txt, one per line, format similar: SessionID 2013-11-6 16:02:13
There is the time to submit data, determine whether session_id exists, if present, then update the time, if not present, then add, if xx long time not updated, then delete ...