The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Timestamp and database., little help please.
imrie
post Jun 23 2007, 02:38 PM
Post #1


Newbie
*

Group: Members
Posts: 15
Joined: 10-April 07
Member No.: 2,477



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Jun 23 2007, 02:57 PM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
imrie
post Jun 23 2007, 03:11 PM
Post #3


Newbie
*

Group: Members
Posts: 15
Joined: 10-April 07
Member No.: 2,477



o

so when all the other sites say we have 22 members online how do they do it?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jun 23 2007, 06:16 PM
Post #4


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
imrie
post Jun 24 2007, 06:22 AM
Post #5


Newbie
*

Group: Members
Posts: 15
Joined: 10-April 07
Member No.: 2,477



how would i do that?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 05:37 AM