Results 1 to 10 of 10
  1. #1

    Php online users counter

    Hi guys,
    I have a website that I would like to have an online user counter. However, I don't want my visitors to check how many users that are in my website. I am already using good analytics but it is not giving me real time data.

    Do you guys know any code that I could put in my html/php pages that can get the job done?
    How can I see total number of users online at a time?
    Any HTML or php codes?


    Thank you in advance!

  2. #2
    By online user counter you mean.. You have registered users on your site..

    you want to count the number of registered logged in users
    or
    you want to count the number of just normal visitors ?

  3. #3
    If you are looking for normal visitors count.. Then try this script.. Its in php .. I found it online.. It works...

    hotscripts.com/listing/digioz-who-is-online/

  4. #4
    Join Date
    Jan 2011
    Location
    India
    Posts
    1,446
    there are many types of free counter available online with which you can easily track your visitors just try to find it in goggle

  5. #5
    Check this site.. I think its got what you need..

    http://24counter.com/
    Your Search For Web Solutions Ends Here -
    Cloud Hosting - VPS Hosting - Reseller Hosting - Web Designing - Web Development
    www.chanan.in
    www.labs.chanan.in

  6. #6
    you could use this, needs to be placed before any HTML in the header.

    Or you could try out chartbeat.com, depends on how important it is to see how many visitors you have online and if you want to pay for it.


    PHP Code:
       <?php
    session_start
    ();  
        function 
    getUsersOnline() {
       
    $count 0;  
           
    $handle opendir(session_save_path());
       if    (
    $handle == false) return -1;  
           while ((
    $file readdir($handle)) != false) {
             if (
    ereg("^sess"$file)) $count++;
       }
       
    closedir($handle);  
           return 
    $count;
    }
    ?>
    then just call it using this

    PHP Code:
    $usercount getUsersOnline(); 
    PC Heroes
    Find links to all the best Opensource Software
    http://www.pcheroes.org

  7. #7
    Quote Originally Posted by humawebdesign View Post
    there are many types of free counter available online with which you can easily track your visitors just try to find it in goggle
    I downloaded the script but i don't get how to use it.

  8. #8

    php online users counter

    ?>
    [/PHP]then just call it using this

    PHP Code:
    $usercount getUsersOnline(); 
    [/QUOTE]

    Thanks for posting, man!
    Hope this helps....

  9. #9

    php online users counter

    [PHP]
    <?php
    session_start();
    function getUsersOnline() {
    $count = 0;
    $handle = opendir(session_save_path());
    if ($handle == false) return -1;
    while (($file = readdir($handle)) != false) {
    if (ereg("^sess", $file)) $count++;
    }
    closedir($handle);
    return $count;

  10. #10

    IMPORTANT!

    Anyone who has installed the online users counter from innovativetechnologyconcepts.com has unknowingly installed a back door on their web server. Upon installation it queries back to their website and announces itself, which their website follows up by sending base64 encoded scripts telling it to modify .php and other files on your server.

    Do NOT under ANY circumstances install or use any script from them!

    Be EXTREMELY wary of ANY script which makes use of EVAL, especially one that will EVAL a base64 encoded POST submission.

    I am posting this here in hopes that the original posters will get a notification email regarding this reply and to warn others who come across this.

Similar Threads

  1. Show users online in a simple php code?
    By BrightStar in forum Programming Discussion
    Replies: 12
    Last Post: 08-30-2012, 06:19 PM
  2. Help with my website Counter(free online counter) project:
    By Alphavillage in forum Programming Discussion
    Replies: 2
    Last Post: 06-05-2004, 07:03 PM
  3. ASP Active Users or Online Users Script
    By Abdillahi in forum Programming Discussion
    Replies: 1
    Last Post: 09-12-2003, 03:02 PM
  4. Replies: 0
    Last Post: 04-14-2001, 07:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •