Your WebCode

Log In / Submit Code / Join     

Find Code
    Highest Rated
    Newest
    Most Viewed
    Browse
           ASP
           ASP.NET
           CSS
           JAVA
           JavaScript
           PERL
           PHP


Sponsors
  
Sites of Interest
   Asp.net Problems
   seminar topics
   Funny Videos
   You Tube videos
   Comedy videos
   Watch YouTube
   Funny You Tube videos
   smart diet
   craiglist
   Asp VS Php

Show Number of Current Visitors

 Language:  ASP
Rated by 2 Users

1 Star = Horrible
5 Stars = Perfect
Rate Code Now
 Posted By:  user5213325
 Author Website:  N/A
 Posted On:  8/7/2007
 Code Views:  683
   This simple code allows you to display the number of currently active visitors into an ASP page.



########### Paste the following code to:
########### /global.asa


<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart
application("CurUsers")=0
End Sub

Sub Application_OnEnd
End Sub

Sub Session_OnStart
application.lock
application("CurUsers")=application("CurUsers")+1
application.unlock
End Sub

Sub Session_OnEnd
application.lock
application("CurUsers")=application("CurUsers")-1
application.unlock
End Sub

</SCRIPT>

########### Display the visitor count in an ASP page with:
<% =application("CurUsers") %>


View code in Textarea

This code has not been tested by Your WebCode.
Use it at your own risk.
Please report any copyright violations.



Reviews
Hide Reviews | Add Review | Delete Review 
Posted by bass_tones on 8/30/2007
Pretty simple old school script. The only problem with this its not always correct, if someone happens to close the browser or leaves the window open past the timeout, then the number of active users are incorrect. The global.asa file never...

Blog | Monthly Contest | Current Contest Leaders | FAQ | Link to us
Privacy Policy | Terms | Credits | Other Sites | Contact Us
Copyright © 2008, Your WebCode.