|
| See Our Code: |
| Back to software listing |
| |
NOTE: This is a databaseless / no database required ASP application
that can be used to log and display the current users to anyone's website. It requires
access to the global.asa file, as well as Application and Session variables. You can
use this on any site, this is completely free.
THIS IS NOT recommended for use on servers with > 500 hits an hour. If you have any
questions please contact me at http://www.beckerist.com/
<!--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. Set this in a file somewhere on your webserver, and include this file into the header of every page you want tracked.-->
<%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
%>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Statistics~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~GLOBAL.ASA~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
|
|