Patrik Andersson Posted December 29, 1999 Share Posted December 29, 1999 Hej! Kan någon hjälpa mig med detta? jag vill på min website ha en räknare som talar om hur många besökare jag har på sidan just nu. Jag vet inte hur man löser det med ASP. Förstår du inte vad jag menar så kolla in www.pcfynd.se dom har en sådan. MVH patrik Andersson www.paraviewdata.com Link to comment Share on other sites More sharing options...
Larsa Posted January 28, 2000 Share Posted January 28, 2000 Pröva med detta! Spara denna som Global.asa <SCRIPT LANGUAGE="VBScript" RUNAT="Server"> Sub Application_OnStart ' Set our user count to 0 when we start the server Application("ActiveUsers") = 0 End Sub Sub Session_OnStart ' Change Session Timeout to 20 minutes (if you need to) Session.Timeout = 20 ' Set a Session Start Time ' This is only important to assure we start a session Session("Start") = Now ' Increase the active visitors count when we start the session Application.Lock Application("ActiveUsers") = Application("ActiveUsers") + 1 Application.UnLock End Sub Sub Session_OnEnd ' Decrease the active visitors count when the session ends. Application.Lock Application("ActiveUsers") = Application("ActiveUsers") - 1 Application.UnLock End Sub </SCRIPT> Sedan ropar du efter scriptet på den sidan där du vill ha det med följande. <%@ Language=VBScript %> <HTML> <HEAD> <TITLE>Active Sessions</TITLE> </HEAD> <BODY> <B><FONT COLOR="#CC0000"><%= Application("ActiveUsers") %></FONT> Active Users</B> </BODY> </HTML> Då skall det nog funka. /Larsa Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.