Record When Was Maximum Users On YOur Site !

  • Thread starter Lovely Angel For You
  • Start date
L

Lovely Angel For You

Dear Friends
Hope you all doing great.

I made a website where I am able to record how many users are online
right now at my website ysing Session_Variables.

Now I want to record the date when I had maximum number of users
online at onetime.

Any idea how can I do that.

Waiting for your reply.

Love
Lovely

--------------------------
 
L

Lovely Angel

Hi
I am using the following script in global.asa. This works fine and let
me know how many users are currently active on my website.

I am using Access database. It also stores total number of hits and
total new sessions also.

Any idea how to tell which date there were maximum active users.

Waiting for your replies.

Love
Lovely

--------------------------------------

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Application("ActiveUsers")=0
End Sub

Sub Session_OnStart
Application.lock
Application("ActiveUsers") = Application("ActiveUsers") + 1
Application.unlock

End Sub

Sub Session_OnEnd
Application.lock
Application("ActiveUsers") = Application("ActiveUsers") - 1
Application.unlock
End Sub
</SCRIPT>
 
R

Ray at

If you have a table that just has this:

TableName: AppCount

MaxCount (Number)
TimeLog (Date/Time)


You could do:

Sub Application_OnStart
Application("ActiveUsers")=0
End Sub

Sub Session_OnStart
Application.lock
iAppCount = Application("ActiveUsers") + 1
Application("ActiveUsers") = iAppCount
objYourADOConnectionToYourAccessDatabase.Execute "UPDATE [AppCount] SET
[MaxCount]=" & iAppCount & ",TimeLog=#" & Now() & "# WHERE " & iAppCount &
">[MaxCount]"
Application.unlock

End Sub


That will execute a query on every new session, and if the new value is
higher than the current value stored in the DB, it will update the record.
Otherwise, it will find no records to update.

Ray at home
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,079
Messages
2,570,575
Members
47,207
Latest member
HelenaCani

Latest Threads

Top