|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
User Online Count
I'm on Mac OSX system, PHP 4:
If anyone knows of where i can get a tutorial on "counting the users currently on my site?" using php, and/or Mysql Thank you. |
|
#2
|
|||
|
|||
|
RE: User Online Count
Frankly, I don't see how it can be done unless you are trying to count the number of users that have logged in. If you simply want to count the number of surfers that have your site in an open window it is not really possible, because once the user's browser loads the page you really have no way to tell that it is still open. If you want to count the number of requests for your page and then display the ones that requested it recently (within a given time period), use the $_SERVER[$REMOTE_ADDR] variable.
|
|
#3
|
|||
|
|||
|
RE: User Online Count
Oh, you may also try and use the onblur() event handler to submit a hidden form that indicates that the browser is not in use, but I am not sure if this will work very well. Check out other javascript event handlers.
|
|
#4
|
|||
|
|||
|
RE: User Online Count
if you are using asp you can use a global.asa
like below <SCRIPT LANGUAGE="VBScript" RUNAT="Server"> SUB Application_OnStart Application("ActiveUsers") = 0 END SUB Sub Session_OnStart Session.Timeout = 1 'Session("Start") = Now Application.Lock Application("ActiveUsers") = Application("ActiveUsers") + 1 Application.UnLock End Sub Sub Session_OnEnd Application.Lock Application("ActiveUsers") = 0 Application.UnLock End Sub </SCRIPT> but i dont know how it is done in php if you find out let me know anthonym@gledhill.net ok |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > User Online Count |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|