How do you have that "how many people" thing?

How do you get a thing for a site like you have in the bottom right of the home page that tells you how many people are surfing your site at a time? Thanks.
Jeff's avatar

An application variable is incremented or decremented every time the session start or end event fires in the global.asa file.

-----------------
Jeff - Webmaster/Admin - CoasterBuzz.com, Sillynonsense.com
"As far as I can tell it doesn't matter who you are. If you can believe, there's something worth fighting for..." - Garbage, "Parade"

Well, Jeff, at least you are honest! :)

-------------
Signature:
(added to forum messages you post)

Good idea, I don't know why I did not think of that...

-------------
Planned Parks for this summer: CP, SFWoA, SFGAm, SFKK, PKI, MA, SFStL, HP, KW, SFMM, KBF. Is 11 enough?

and all of that means.... lol.
You mean like a counter?

-----------------
CAK91687
Visit my improved and better site!
http://www.geocities.com/cak91687/Coaster_Amusement.html

There's lots of already made scripts out there, find em!

-----------------
.:| Brandon Rodriguez |:.
http://www.coasters2k.com

Chris, there might be something like that on CGI Resources or PHP Resources but you need to be able to run cgi or php which you can't do on Geocities.

-----------------
Off with the trims!
My fellow Americans; Let's Roll!
http://www.woodencoaster.com

I would bet that its ASP(like everything else on this site). A simply session counter would do the trick. Bascially it counts the number of "session" or people that are currently viewing the site.

- Andrew Hyde
http://www.experiencethepoint.com

Jeff's avatar

Isn't that what I said in the first place?

-----------------
Jeff - Webmaster/Admin - CoasterBuzz.com, Sillynonsense.com
"As far as I can tell it doesn't matter who you are. If you can believe, there's something worth fighting for..." - Garbage, "Parade"


BrandonR said:
"There's lots of already made scripts out there, find em!

-----------------
.:| Brandon Rodriguez |:.
http://www.coasters2k.com"


I know of one, however, it is not customizable in any way and is actually very ugly. I love how the one here looks just like plain text. Where can I get some other pre-made scripts?


Isn't that what I said in the first place?


You tell us!

-----------------
Jes
Jes's Roller Coasters DJ Jes MCS
"Thank You Jeff Putz"

It is -- he even says "each time a session starts or stops"

;)

-----------------
--Greg
"The collective women in your life have more baggage than a Samsonite factory..."
My page

Why don't you and the fricken counter get a fricken room!? ;) hehe. I've found some source codes if you're interested. Email me and I'll send you the link to some.

-----------------
"Your love is like a roller coasta' baby baby..."
If love is like a rollercoaster, doesn't that mean you should be happy ALL of the time? ;)

Shawn Bailes
110 Drumline
http://www.ohiou.edu/marching110/drumline
|
| | |
/| | | | |\
/

Kick The Sky's avatar
You don't need a script. All you need is one application level variable that is set to zero in the application start event, incremented in the session start event and decrememted in the session end event. Not to hard.

-----------------
Bob Hansen

Marquette a five seed? They were robbed!!!

Jeff's avatar

Stick this in your global.asa file, then use Response.Write Application("ActiveUsers") where ever you want the number to appear.

Sub Application_OnStart
' Set our user count to 0 when we start the server
Application("ActiveUsers") = 0
End Sub

Sub Session_OnStart
' Change Session Timeout to 20 minutes (if you need to)
Session.Timeout = 20
' Set a Session Start Time
' This is only important to assure we start a session
Session("Start") = Now
' Increase the active visitors count when we start the session
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") + 1
Application.UnLock
End Sub

Sub Session_OnEnd
' Decrease the active visitors count when the session ends.
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") - 1
Application.UnLock
End Sub

-----------------
Jeff - Webmaster/Admin - CoasterBuzz.com, Sillynonsense.com
"As far as I can tell it doesn't matter who you are. If you can believe, there's something worth fighting for..." - Garbage, "Parade"

*** This post was edited by Jeff on 3/12/2002. ***


Jeff said:

pointless quotation removed



Thanks! Is taht alll I need? Anddo I have to save thepage I use thin as .asp?

*** This post was edited by titanfan on 3/13/2002. ***

*** This post was edited by Jeff on 3/13/2002. ***

Jeff's avatar

Actually, it is cut-and-paste in this case. That's why I posted it.

-----------------
Jeff - Webmaster/Admin - CoasterBuzz.com, Sillynonsense.com
"As far as I can tell it doesn't matter who you are. If you can believe, there's something worth fighting for..." - Garbage, "Parade"

You must be logged in to post

POP Forums - ©2024, POP World Media, LLC
Loading...