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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Users online 1

Status
Not open for further replies.

durug

Technical User
Mar 22, 2002
335
CA
Hi everybody!

Does somebody knows (or point me to a script) how to show the number of users online (online: the number of users accesing your application in a point of time)

Thanks a lot,
Durug
 
You could modify the users' info table, and add two more fields, "active" and "lastlogin"

I like to use lastlogin for my admin site, to see who logged in recently.

WHen a user logs in, ( if password matches suers' password in the DB ) then update that users' record with
--->set active=1 , lastlogin='"&now()&"' where UID=1

I figure Active can be a bit flag, True / False and LastLogin can be a datetime.

Now when you want to show active users, do a select of members table where active=0 or true. From that you can extract the details and show them if you want.

japes



_______________________________________________
OutsideIntranets.com
Stop wasting time, get to work
 
thanks japes.
but how I figure out when the user leaves the site if there is no logout? So that I switch the active field to false ?

I thought there should be some settings in IIS or something else.

Thanks anyway,
Durug
 
You can use the Application level variables to do this stuff.

Correctly pointed in one of the posts, use the Global.asa to declare Application level variables. And also check for more info on Application.Lock, Application.Unlock, using which you can lock and unlock the application variables, before incrimenting or decriminting the value, based on Session on Start and session on End.

Say a person logs on, now you have a new session starting, so you inc the Application level variable by one (before doing that you lock it, and after inc unlock it). Now in the Session on End repeat the same routine and also dec the value of the Application variable.

Hope it helps,
Reagrds,
Vikas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top