how does the script work for this site (or any) for seeing who is currently logged in ? i'm sat thinking about it for quite some time now but cant figure it out. any clues ? :D
Printable View
how does the script work for this site (or any) for seeing who is currently logged in ? i'm sat thinking about it for quite some time now but cant figure it out. any clues ? :D
well there be some database for the users and the messages so i would think that when you login you some how set a marker in the database. which will tell you who is online.
correct, it also has session varialbe that work with that marker in the database.
u seem to know what your talking about scoutt, could u explain a bit more maybe ?Quote:
Originally posted by scoutt
correct, it also has session varialbe that work with that marker in the database.
I'll try :)
lets say you have a table in the database that is labeled "online" so when a user logs in a 1 will be put in the "online" table. so everytime someone loads the index page to what ever page you want it to show, it looks at that online table and finds all the "1" and then say user scoutt has a one so we check for a session variable and then say yup he is online. if the session variable is not there, then we say update the online table and put a 0 in there. and delete the session that is loaded in the table.
make sense?
yeh, 100% sense; but the part i cant figure is how it knows that the person has left, does it have a timer or something so that if a user hasnt updated the "online table" then it changes the '1' to a '0' ??
well I'm not totally sure on that. I would have to research it to be 100% sure.