SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Dynamic HTML :

Previous DiscussionNext Discussion
 Global.asa to track hits

I have created a dynamic website, and i'm looking to add some dynamic code to it. I am unable to the session variable to display the total number and current number of visitors.

The global asa is as follows:

<script language="vbscript" runat="server">
Sub Session_OnStart
Application.Lock
Application("TotalNumberOfUsers") = Application("TotalNumberOfUsers") + 1
Application("CurrentNumberOfUsers") = Application("CurrentNumberOfUsers") + 1
Application.Unlock
End Sub

Sub Session_OnEnd
Application.Lock
Application("CurrentNumberOfUsers") = Application("CurrentNumberOfUsers") - 1
Application.Unlock
End Sub
</script>

the index.asp is follows

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="file:///D|/missing%20manual/2nd%20edition/dynamic%20tutorials/DWDynamic/cosmo_root/global.css" rel="stylesheet" type="text/css">
</head>

<body class="content">


<h1>Dreamweaver 8: The Missing Manual </h1>
<p>You did it! The Web server is working, you put the files in the correct place,
and, if you see the date below, the application server is correctly processing
the ASP code in this page. Hoorah!</p>
<p>Today's date and time: <b><%= Now() %></b></p>
<%
dim bc
set bc = server.createobject("MSWC.browsertype")
If not Cbool(bc.cookies) then
%>

Sorry your browser
<b><%=bc.broswer & " " & bc.version%></b>
does not support cookies. To use this site you need a browser that does.

<% else %>
</div>
<p align="center" class="style53 style33">You are using - <%=bc.browser %> Version -
<% = bc.version %>
<br />
Your Browser supports ActiveXControls - <%=bc.activeXcontrols%><br />
Your Browser supports cookies - <%=bc.cookies %><br />

<% end if%>
&nbsp;</b><br />
<p>&nbsp;</p>

Total number of visitors: <%=Application("TotalNumberOfUsers")%><br>
Current visitors: <%=Application("CurrentNumberOfUsers")%><br>
<p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="550" height="400">
<param name="movie" value="symbols.swf">
<param name="quality" value="high">
<embed src="symbols.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="400"></embed>
</object>
</p>
</body>
</html>[
All the other dynamic code works, any ideas as to why i can't get the session data displaying.

TIA

Dave

Started By racine on Mar 13, 2007 at 4:16:58 AM

2 Response(s) | Reply

Earlier Replies | Replies 2 to 2 of 2 | Later Replies
brian on Mar 13, 2007 at 6:46:41 AM (# 2)

Yeah, that doesn't work because closing the browser or leaving the site doesn't end the session. It needs to timeout and that takes as long as the session timeout is set to and even then, don't count on it.


Earlier Replies | Replies 2 to 2 of 2 | Later Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.