VB icon

_-~Who is looking at your site? v1.3~-_

Email
Submitted on: 1/6/2015 7:14:00 AM
By: JSBeckerist (from psc cd)  
Level: Intermediate
User Rating: By 12 Users
Compatibility: ASP (Active Server Pages), HTML
Views: 1759
 
     Allows you to see the user sessions and pages that each user is viewing on your website currently. Updated so now it works, but just hides the application variables. PLEASE VOTE FOR THIS SCRIPT! Kudos to Brian Battles, check out his scripts. Plus, you have to love statistics... Otherwise don't bother :) Its a pain but if you need to know stats (like me) its worth it.

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
' for :_-~Who is looking at your site? v1.3~-_
'**************************************
Go to Beckerist.com for a working model. Use this code freely... PLEASE VOTE FOR THIS CODE!
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: _-~Who is looking at your site? v1.3~-_
' Description:Allows you to see the user sessions and pages that each user is viewing on your website currently. Updated so now it works, but just hides the application variables. PLEASE VOTE FOR THIS SCRIPT! Kudos to Brian Battles, check out his scripts. Plus, you have to love statistics... Otherwise don't bother :) Its a pain but if you need to know stats (like me) its worth it.
' By: JSBeckerist (from psc cd)
'
' Assumes:Must be able to use a global.asa. Almost impossible to use without. Be sure to set your session timeout to 10 minutes or so if at all possible. You will see a bunch of people that aren't there if you don't.
'
' Side Effects:Good idea to restart your global.asa file as often as possible.
'**************************************

<!--This goes into a page which you include on ALL PAGES IN YOUR SITE... This is how you post things so that you can list them-->
<%APPLICATION.LOCK
sSessURL= Request.ServerVariables ("URL")
sQString= Request.ServerVariables ("QUERY_STRING")
if sQString <>"" then
sSessURL=sSessURL&"?"&sQString
end if
if session("name1")<>"" then
	Application("yoyo"&Session.SessionID) = Null
	sSessID=session("name1")
else 
	sSessID = Session.SessionID
end if
Application("yoyo"&sSessID) = sSessURL
APPLICATION.UNLOCK
%>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~New Page~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--This is the page that you want to output the users on, you can add more variables as it goes on-->
<h2 align="center">Yourdomain.com Stats - Who Is Online?</h2>
<BR>
<!--#include virtual="include_top_page.asp"--><center>
<%if request.form("name1")<>"" then
session("name1")=request.form("name1")
elseif session("name1")<>"" then%>
Hello <%=session("name1")%>!
<%else%>
<form method="Post" action="">
Give yourself a name: 
<input type="text" name="name1"><input type="submit" value="Give me the name!"></form>
<%end if%>
<table>
<tr><td width="50%">Session ID</td><td>Looking where?</td></tr>
<%
 For Each strSV in Application.Contents
 		if left(strSV,4)="yoyo" then
if Application.Contents(strSV)<>"" then%> 		
 <tr><td><%=mid(strSV,5,999)%></td><td><%=Application.Contents(strSV)%></td></tr>
<%end if%><% end if
 Next%></table>New Page~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!-- This next part goes in the session_onend sub in your global.asa file-->
Sub Session_OnEnd			
	Application.Lock
		sSessID = Session.SessionID
		Application("yoyo"&sSessID) = ""
	Application.Remove "yoyo"&sSessID
	Application.Unlock
End Sub


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.