Hi,

You will want to use a separate table not the user table since this 
will be scratch data. If you want to display split values for users 
and guests assign everyone an ID from the new table and place that in 
a cookie var. By using a cookie you can see if a visitor has been to 
the site, even if they closed their browser and came back. When a 
guest logins in update the table to record assigned to the ID reflect 
a user instead of a guest. You can then get counts for each type. 
You'll also want to dump old data from the table periodically.

I think 10 minutes is too short. What kind of site is this? I'd think 
20 to 30 minutes would be  better, especially if you have any reading 
material.

Sincerely,
Mike
--
Mike Brandonisio          *    Web Hosting
Tech One Illustration     *    Internet Marketing
tel (630) 759-9283        *    e-Commerce
[EMAIL PROTECTED]    *    http://www.jikometrix.net

     JIKOmetrix - Reliable web hosting


On May 20, 2006, at 9:38 PM, [EMAIL PROTECTED] wrote:

>>  On May 20, 2006, at 6:31 PM, [EMAIL PROTECTED] wrote:
>>
>>> I'd like to add a "who's online" section to my home made forum.
>>> When a user logs-in they are given a session $_SESSION['user']
>>> (containing their username) for the duration of their stay.
>>>
>>> How can I use PHP to list all of the currently active 'user'
>> sessions
>>> that the system has created?
>>
>>> On 21 May 2006, at 10:56, Mike Brandonisio wrote:
>>>
>>> You'll have to write your data to a table since other users will 
>>> have
>>> query the table to count how many entries are live. You'll also have
>>> to figure out how to deal with people who leave the site.
>
> OK, I can deal with that by adding a "last active" column to the user
> table & a function that writes in the date/time.
> The function can be called on every page & if the date/time for the
> user is older than 10 mins I can assume they are logged out.
>
> Does that sound reasonable?
>
> What about browsing guests - not logged in - any suggestions on how I
> should deal with them?
>
> cheers
> riquez
>
>
> ------------------------ Yahoo! Groups Sponsor --------------------
> ~-->
> Get to your groups with one click. Know instantly when new email 
> arrives
> http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/HKFolB/TM
> --------------------------------------------------------------------
> ~->
>
> Community email addresses:
>   Post message: php-list@yahoogroups.com
>   Subscribe:    [EMAIL PROTECTED]
>   Unsubscribe:  [EMAIL PROTECTED]
>   List owner:   [EMAIL PROTECTED]
>
> Shortcut URL to this page:
>   http://groups.yahoo.com/group/php-list
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>



Community email addresses:
  Post message: php-list@yahoogroups.com
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




SPONSORED LINKS
Php mysql Job postings


YAHOO! GROUPS LINKS




Reply via email to