|
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/2007Pretty 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... |
|