Results 1 to 2 of 2

Thread: help with global.asa

  1. #1
    Join Date
    Apr 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help with global.asa

    hi, I want to use global.asa information to count members online. But...
    How to collect information on Sub session_OnStart. I want on:

    Sub Session_OnStart
    session("IP_number")=Request.ServerVariables("remote_addr")
    session("time")=time()
    end sub

    then want to use this information and put in the table (members table),
    and on the end to delete information from table???

    HOW, PLEASE HELP ME !!!

  2. #2
    Join Date
    Apr 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    this is the code you need to count user online for your webapplication:

    add this lines to your global.asa:
    PHP Code:
    Sub Application_OnStart
        Application
    ("ActiveUsers") = 0
    End Sub 
    PHP Code:
    Sub Session_OnStart
        Application
    .Lock
            Application
    ("ActiveUsers") = Application("ActiveUsers") + 1
        Application
    .UnLock
    End Sub 
    PHP Code:
    Sub Session_OnEnd
        Application
    .Lock
            Application
    ("ActiveUsers") = Application("ActiveUsers") - 1
        Application
    .UnLock
    End Sub 
    Your code stores only the ip from the client in a session-variable and the beginning of the session.

    If you want to see more information who is online, simply store this informations into application-variables.

    best wishes

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •