Print Page | Close Window

GLOBAL.ASA

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=199
Printed Date: 28 March 2026 at 10:23pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: GLOBAL.ASA
Posted By: skyworld
Subject: GLOBAL.ASA
Date Posted: 15 February 2003 at 3:46pm

i have a script that i made for my site using it.. My question is i want it to add one to application("guests") if they are not logged in and if they are i want it to be add 1 tto APPLICATION("members") but where would the script that ads it go ? I was thikning global.asa but that wouldnt work and dont i need to be in the file for something to get down. I also need it to minus 1 to them when they leave for guests and members

So far my code is....

<script language="vbscript" runat="server">

Sub application_OnStart
Application("totalonline") = 0
Application("Guests") = 0
Application("Members") = 0
end sub

Sub application_onend
end sub

Sub Session_OnStart
application.Lock
application("totalonline") = application("totalonline")+1
APPLICATION.lock
end sub

Sub Session_onend
application.lock
application("totalonline") = Application("totalonline")-1
application.unlock
end sub
</script>

Please help




Replies:
Posted By: Mart
Date Posted: 17 February 2003 at 8:24am

When they login you can go

<%applicarion("Members")+1%>

<%application("Guests")-1%>



Posted By: Mart
Date Posted: 17 February 2003 at 8:25am
Don't quote me though


Posted By: skyworld
Date Posted: 17 February 2003 at 9:08am

about when they leave though?



Posted By: Mart
Date Posted: 17 February 2003 at 9:42am

How about on your main page writing <%session("guest")=1%> then on the login success page writing <%session("member")=1%> then in global.asa try this:

Sub Session_onend
application.lock
application("totalonline") = Application("totalonline")-1

if session("member")=1 then

application("members")-1

else

application("guests")-1

end if
application.unlock
end sub

 

I dont know if you can use the if statement in global.asa but I think you probably can do it that way.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net