Help - Search - Members - Calendar
Full Version: Timestamp and database.
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
imrie
Ok, i have a database of registered members, i want it to say "X members online" when they are logged in. How could i do this. I think is what i need to do is to have a timestamp that logs when they are online every 5-10 mins and calls up the number from the database.

Only question is...........how?

thanks.
Brian Chandler
There is actually no such thing as "online", since http is a sessionless protocol. So like everyone else, you fake up some nonsense, and pretend that a person is "online" for 5 minutes, or 10 minutes, or whatever the global standard nonsensical figure is. Then you keep a list of "online members" (database table: memberID, timeleft), and each time someone accesses a page, you set their timeleft value to 10 (or whatever), and every minute you run a function that decrements all the timeleft values.

Can I have a patent on that please, since I just invented it?
imrie
o

so when all the other sites say we have 22 members online how do they do it?
Darin McGrew
It means that "22 members" have requested a page from the server within the last n minutes, where n is defined by whoever implemented the "members online" feature.
imrie
how would i do that?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.