MySQL
  Home arrow MySQL arrow Finding How Many Users Are On Your Site Wi...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Finding How Many Users Are On Your Site With PHP
By: Joe O'Donnell
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 16
    2002-04-27

    Table of Contents:
  • Finding How Many Users Are On Your Site With PHP
  • Building the database
  • Creating the PHP script
  • Displaying the number of users
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Finding How Many Users Are On Your Site With PHP


    (Page 1 of 5 )

    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!One of the many cool things that I seem to notice when browsing around the Internet is the "xxx users currently online" feature of many web sites. 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. It's also a great way to show advertisers just how serious your site is and to show them that it's worthy of their hard earned advertising dollars.

    In this article we're going to use PHP and MySQL to create a simple script that shows how many people are currently browsing our web site. We will create two scripts: one which adds users details to the database and another which tallies them up. This script will also be able to display the number of users online in a small sentence, such as "There are currently 245 users online".

    To implement the scripts and database that we're going to create, you should be running a web server with PHP 4.1.0 or above and MySQL 3.23 or above installed. I will assume that you have an intermediate knowledge of PHP and MySQL, however don't worry too much about the code as it is fairly easy to follow.

    More MySQL Articles
    More By Joe O'Donnell


     

    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 ...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway