Re: figure out how many users are online?
| From: | Magnus Hammar | Date: | Sat, 16 Dec 2000 22:08:38 +0000 |
| Subject: | Re: figure out how many users are online? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30684@lists.php.net to get a copy of this message | ||
I forgot to say that I update the time and date if the IP allready excists
in the table when they access a page, in that way they will be "online"
according to the database, untill the 10 min has passed.
On 2000-12-16 23.05, "Magnus Hammar" <magnus@programmering.nu> 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