Re: figure out how many users are online?
| From: | Magnus Hammar | Date: | Sat, 16 Dec 2000 22:05:48 +0000 |
| Subject: | Re: figure out how many users are online? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30683@lists.php.net to get a copy of this message | ||
On 2000-12-16 22.54, "Jacob Cherry" <jakedc@iname.com> wrote:
> is there a simple way to figure out how many users are logged onto my site?
> i dont care when they logged on, or for how long, i simply want to know how
> many ppl are on. i have mysql database running if that helps.
>
> thanks!
I made this function myselfe on my site.
I simply logged their IP-addresses and then also saved the time and date +
10 min or so when the user access a page.
Then I select all IP-addresses that has been saved that is less than the
current date or later than the current time like:
mysql($database,"select * from tUsersOnline where (date < '$totays_date' OR
date='$todays_date' AND time > '$time_now')");
In the same time I delete the "old" data that isn't interesting anymore.
I hope this will give you an idea of how to do this :-)
MVH
/Magnus Hammar