Hi Dave,
> It's the number of people currently connecting to the website
> at the current moment and also if we can determent what IP
> they are coming from would be great.
You can use the following procedure in Global.asa:
'// ========================================================
<script language="vbscript" runat="server">
Sub Application_OnStart()
Application.Lock
Application("lCurrentVisitors") = CLng(0)
Application("lMaxVisitors") = CLng(0)
Application("lDMaxVisitors") = Now()
Application.UnLock
End Sub
Sub Session_OnStart()
Application.Lock
Application("lCurrentVisitors") = Application("lCurrentVisitors")
+ 1
If Application("lMaxVisitors") < Application("lCurrentVisitors")
Then
Application("lMaxVisitors") = Application("lCurrentVisitors")
Application("lDMaxVisitors")= Now()
End If
Application.UnLock
End Sub
Sub Session_OnEnd()
Application.Lock
Application("lCurrentVisitors") = Application("lCurrentVisitors")
- 1
If Application("lCurrentVisitors") <0 then
Application("lCurrentVisitors")=0
Application.UnLock
End Sub
Sub Application_OnEnd()
'
End Sub
</script>
'// ========================================================
That'll get you the number of current visitors. As far as determining IP
address you'd need to create your own session management system. An
Access database with a table with the fields you'd actually want to
track - probably IP, useragent, date/time start, initial page, query
terms (if any) from search engine/referer, last click, sessionid...
You'd call an update method to the applicable SessionID record at the
start of every new ASP request and initially populate the data in the
Session_OnStart method above.
Now, mind you, this list is really not for ASP or ASP.net, so this would
be more appropriate on the ASP list:
http://groups.yahoo.com/group/active-server-pages/
Regards,
Shawn K. Hall
http://12PointDesign.com/
http://ReliableAnswers.com/
'// ========================================================
Hello, my name is Inigo Montoya. You killed my father.
Prepare to die.
-- 'Inigo', The Princess Bride
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12ht9n5l7/M=362329.6886308.7839368.1510227/D=groups/S=1705115364:TM/Y=YAHOO/EXP=1124876108/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
'// =======================================================
Rules : http://ReliableAnswers.com/List/Rules.asp
Home : http://groups.yahoo.com/group/vbHelp/
=======================================================
Post : [email protected]
Join : [EMAIL PROTECTED]
Leave : [EMAIL PROTECTED]
'// =======================================================
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/vbhelp/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/