Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2005-06-24, 06:54 AM
Junior Member
 
Join Date: Apr 2005
Posts: 14
jeephp
Default

I am currently working on a membership based web site. I need to display the number of members

logged in that system. To do this I have set a flag in the database which is set to 1 whenever a

user is logged in the system and when the user clicks on the ‘Log Out’ link a query is fired that

sets the same flag to 0. To display the total number of logged in members I run a query that counts

the number of records whose flag is set to 1.

However this method has a major shortcoming. When users do not click the ‘Log Out’ link but just

close the browser. In such a situation the query that will set the flag field back to 0 will bot be

fired and hence the user would be seen as active in the system even though the user has already left

the system.

When one company is viewing the profile of another company in my site I also need to show whether

that representative of the company whose profile is being viewed in logged in the system at that

time or not so that if the user wants then can send a message to them.

I need some advice on how can I achieve this in the best possible way, where I can display the total

number the total number of correct logged in members

Thanks a lot!

Cheers
Paresh
Reply With Quote
  #2 (permalink)  
Old 2005-06-24, 08:26 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

add last visit to your table, and use it as a timestamp, then just show the number of members that have had a visit in X number of minutes, somewhere between 5 and 15 works.

Ditto with page, add a field that says page, and just show the users looking at a specific page.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:03 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.