how many connected users? [closed]
is there a way to know how many ip's are connected on your site address using php or js?
At least not using JavaScript :) In PHP you basically need to hook on every HTTP request and then INSERT
or UPDATE
a row in a online_user
table based on the session ID as key and current timestamp as value. When requesting the data, first DELETE
the users who have not been online for more than X minutes ago and then do a SELECT COUNT
on the table.
Not a single one.
Clients not being connected to your site all the time.
They connect, get page contents, and disconnect.
You can just estimate a rough number, based on number of recent requests
精彩评论