Users online: 428 Page loadtime: 0.3035

Discussion in 'PHP' started by supercops, May 30, 2010.

  1. #1
    Hello Guys

    Can some one help me in putting up this data on my site just like some of other sites....for example at the bottom on the index page at website outlook dot com you will see this.
    Users online: 428 Page loadtime: 0.3035

    Can you please let me know how this is done ?
     
    supercops, May 30, 2010 IP
  2. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
  3. Gray Fox

    Gray Fox Well-Known Member

    Messages:
    196
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #3
    
    $usersOnline = count(glob(session_save_path().'/sess*')); // counting active sessions
    $pageLoadtime = microtime(true) - $_SERVER['REQUEST_TIME'];
    
    PHP:
     
    Gray Fox, May 31, 2010 IP
  4. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #4
    Well the best way to do is use http://whos.amung.us/ service.You just need add a js script at the footer and it will display no of users online.
     
    abhijit, May 31, 2010 IP
  5. supercops

    supercops Peon

    Messages:
    1,344
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Where I have to put this code...I am getting some errors..........
     
    supercops, May 31, 2010 IP
  6. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #6
    Can you post the error here.
     
    abhijit, May 31, 2010 IP
  7. taminder

    taminder Peon

    Messages:
    581
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    This might help:

    http://www.php-development.ru/php-scripts/site-statistics.php
    Code (markup):
     
    taminder, Jun 4, 2010 IP
  8. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #8
    
    
    <?php
    $usersOnline = count(glob(session_save_path().'/sess*')); // counting active sessions
    $pageLoadtime = microtime(true) - $_SERVER['REQUEST_TIME'];
    
    echo $usersOnline, ' : ', $pageLoadtime;
    ?>
    
    PHP:
     
    gapz101, Jun 4, 2010 IP
  9. supercops

    supercops Peon

    Messages:
    1,344
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #9
    it worked and is showing me the number of users online as 600 plus and I think its showing the users online for the server and I want the users online for my site only as I m on a shared server ..
     
    supercops, Jun 5, 2010 IP