| Cool SurferStarting Member
 
 
 
                India32 Posts
 | 
                    
                      |  Posted - 15 August 2003 :  07:41:40     
 |  
                      | 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
 
  |  |