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
 Code Support: ASP (Non-Forum Related)
 Global.asa Help Pl
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Cool Surfer
Starting Member

India
32 Posts

Posted - 15 August 2003 :  07:41:40  Show Profile  Visit Cool Surfer's Homepage
Hello Friends,
I need some here pl. Below is my global.asa file
which keeps track of no of active visitors and
routine logging to a .txt file.

I need to call ONLY active visitors with their ip's
and date and time, thro a diff .asp file eg ip.asp

Pl help, i need it for my website.
Thanks

James
Email: jamesmedline@lycos.co.uk
.........................
Global.asa file content.


<SCRIPT LANGUAGE=VBSCRIPT RUNAT=SERVER>
on error resume next
dim date_stamp
date_stamp=Now()
dim fs,f
dim tst
tst=server.mappath("/testread.txt")
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile(Server.MapPath("/testread.txt"),8,true)
f.WriteLine("Vistor visted u r site" & chr(32)& request.servervariables("REMOTE_ADDR") & chr(32) & "ON" & chr(32) & date_stamp)
f.Close
set f=Nothing
set fs=Nothing
'Response.Write "Cool!!"

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

Sub Application_OnEnd
'no code is needed here
End Sub

Sub Session_OnStart
Session.Timeout=5
Session("Start")=Now
Application.Lock
Application("Active")=Application("Active")+1
'this adds 1 to the number of active users when a new user hits
Application.unlock
End Sub

Sub Session_OnEnd
Application.Lock
Application("Active")=Application("Active")-1
'this subtracts 1 from the number of active users when a new user leaves
Application.unlock
End Sub

</SCRIPT>

Cool Surfer

Doug G
Support Moderator

USA
6493 Posts

Posted - 15 August 2003 :  13:01:27  Show Profile
You can't execute code in global.asa other than in the defined application and session on_start and on_end event subs.

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

Cool Surfer
Starting Member

India
32 Posts

Posted - 15 September 2003 :  08:03:59  Show Profile  Visit Cool Surfer's Homepage
thanks friend
now its finally working.

Cool Surfer
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07