Home arrow MySQL arrow Page 5 - Finding How Many Users Are On Your Site With PHP
MYSQL

Finding How Many Users Are On Your Site With PHP


Counting the number of users that are currently browsing your site is a great way to brag about your high number of unique visitors if you're running a busy web site. In this article Joe shows us how to use PHP and a MySQL database to show the common "There are currently 23 users online" text on our web site. He uses two very simple scripts to do this, and the result is small, quick and informative. If you run your own site, then be sure to check this article out!

Author Info:
By: Joe O'Donnell
Rating: 5 stars5 stars5 stars5 stars5 stars / 21
April 27, 2002
TABLE OF CONTENTS:
  1. · Finding How Many Users Are On Your Site With PHP
  2. · Building the database
  3. · Creating the PHP script
  4. · Displaying the number of users
  5. · Conclusion

print this article
SEARCH DEVARTICLES

Finding How Many Users Are On Your Site With PHP - Conclusion
(Page 5 of 5 )

In this article we've seen how to implement a users online counter with PHP and MySQL. As mentioned earlier, PHP has no way of tracking a session, so we've had to make do with the tools and information that we do have available.

The way we've tallied and displayed the number of users is the most common way to do so, and will represent the number of users on your site fairly accurately. If you run a web site and would like to show your users how many other visitors are online at the same time as them, then user the support file link below to get the code for this article and modify it to suit your needs!
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
MYSQL ARTICLES

- MySQL and BLOBs
- Two Lessons in ASP and MySQL
- Lord Of The Strings Part 2
- Lord Of The Strings Part 1
- Importing Data into MySQL with Navicat
- Building a Sustainable Web Site
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- PhpED 3.2 More Features Than You Can Poke ...
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- Security and Sessions in PHP
- Setup Your Personal Reminder System Using PHP
- Create a IP-Country Database Using PERL and ...
- Developing a Dynamic Document Search in PHP ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials