Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Global.asa
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 28 April 2005 :  06:51:47  Show Profile  Send pdrg a Yahoo! Message
You could use the application_onstart event to trap/track this info?

in global.asa, only the session and application objects would be relevent to your aims.

hth
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 28 April 2005 :  08:07:41  Show Profile
Does that mean I have too much code here?

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
' Lock the Application object
Application.Lock
' Increment the count
Application("VisitorsToday") = Application("VisitorsToday") + 1
' Unlock the Application object
Application.Unlock
End Sub
</SCRIPT>
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 28 April 2005 :  09:23:21  Show Profile  Send pdrg a Yahoo! Message
you know, I'm not sure about the application.lock and .unlock - don't really see what they're for in this case

http://www.siteexperts.com/tips/backend/ts13/page1.asp may be helpful, but dig around the usual asp tutorial site suspects, you'll find some copy & pasteable code soon enough, I'm sure :)
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 28 April 2005 :  12:55:46  Show Profile
There still is no test to roll over your count when it's a new day. You need something like this above where you increment the counter. You'll have to work out what to really use in place of Today and Yesterday :)

If Today = Yesterday Then
Application("VisitorsToday") = 0 'reset the counter for a new day
End If

Then increment your counter.

Also, in a Sub Application_OnStart() event you should initialize the counter to a numeric value

Sub Application_OnStart()
Application("VisitorsToday") = 0
End Sub

Application.lock is a good idea when you're updating an application variable, using lock and unlock prevents concurrency problems with other users.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 04 May 2005 :  09:42:25  Show Profile
Doug, thanks - could you write the complete code for this, so I get it right?

Thanks a lot.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07