View previous topic :: View next topic |
Author |
Message |
gingel -
Joined: 09 Apr 2004 Posts: 25
|
Posted: Sun Sep 16, 2007 3:46 pm Post subject: how to know how many people are online? |
|
|
i know i need to use Global.asa but it's not fully supported by Activehtml.
anyone have an idea on how to do that?
Erez. |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
Posted: Sun Sep 16, 2007 7:07 pm Post subject: |
|
|
There's a simple solution for you if you host only one domain.
Automatically assign a persistent session that lasts for, say, 15 minutes. That assumes you consider a person's online presence for 15 minutes after their last request.
Then just count the sessions in the server directory that holds session information.
Otherwise, here's the concept:
Make a table, whether it exists in a file or in a database.
This table stores records like: IP.address|timestamp.
For every web request (good to put this code in your global file), compare the IP address with the list in the table. Then see if it has been in the past 15 minutes. If not, record them at the top of the table.
Also, for every request, count the number of IP addresses that have accessed your in the past 15 minutes.
I don't know anything about ASP, but I imagine you could find such script already made: http://stephen.calvarybucyrus.org/search/asp+online+user+counter _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
rrinc -
Joined: 24 Feb 2006 Posts: 725 Location: Arkansas, USA
|
Posted: Sun Sep 16, 2007 10:06 pm Post subject: |
|
|
You could create a session handler that uses a database, that's probably the best way.
Edit: I was talking about PHP, sorry. Not sure if you can do it in ASP too. _________________ -Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados.
Last edited by rrinc on Mon Sep 17, 2007 11:14 pm; edited 1 time in total |
|
Back to top |
|
|
gingel -
Joined: 09 Apr 2004 Posts: 25
|
Posted: Mon Sep 17, 2007 9:21 pm Post subject: |
|
|
how do i count the sessions in the server directory that holds session information? |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
Posted: Mon Sep 17, 2007 9:50 pm Post subject: |
|
|
Get a directory listing. It should give you a count. On the specifics, it depends on your operating system. _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
|