Current Active Users on Your Site Header

Current Active Users on Your Site

  [Call : 201-377-9031 (US) 0207-096-0627 (UK)]          About Us : Support : Contact  : Site Map 
    Home | Products | Hosting | Services | Resources | FAQ
HomeCurrent Active Users on Your SiteResourcesCurrent Active Users on Your Site
Home Products Hosting Services Resources FAQ
Resources

Current Active Users on Your Site
Posted by : Amit Agarwal Total Hits : 12918

Did you know you could track the number of Current Users on your site with a simple addition to your Global.asa , the code below explains how you can do it in detail..


  
Get the Source Code.
' This is your global.asa file

<SCRIPT LANGUAGE=VBScript RUNAT=Server>

Sub Application_OnStart

   'CurrentUsers Application variable with 0 value when the Server Starts
   Application("CurrentUsers") = 0

End Sub

'When a new user comes to your site a new session is started
Sub Session_OnStart

   'Add 1 to the value of CurrentUsers Application Variable when a new session is started
   Application.lock
   Application("CurrentUsers") = Application("CurrentUsers") + 1
   Application.unlock

End Sub

Sub Session_OnEnd

   'Reduce 1 from the value of CurrentUsers Application Variable when a session ends
   Application.lock
   Application("CurrentUsers") = Application("CurrentUsers") - 1
   Application.unlock

End Sub

</SCRIPT>

'You can now use the above CurrentUsers Application Variable anywhere in your ASP pages to show your current users

Response.write Application("CurrentUsers")

 
Source Code






Countries where our products are used.


 Copyright © 2006 ScriptMate. Current Active Users on Your Site 
Password Protection :: Church Membership Software :: Membership Management Software
Membership Software :: User Management :: Classified Ads Software :: FAQ Management Software :: Free VBScript Resource
Bunk Beds :: Cribs :: Cradles Kids Furniture :: New Born Baby Furniture :: Baby Furniture