Jump to content

Recommended Posts

Is this what your looking for?

 

<?php
session_start(); 

define("MAX_IDLE_TIME", 3); 

function getOnlineUsers(){ 

if ( $directory_handle = opendir( session_save_path() ) ) { 
$count = 0; 
while ( false !== ( $file = readdir( $directory_handle ) ) ) { 
if($file != '.' && $file != '..'){ 
if(time()- fileatime(session_save_path() . '\\' . $file) < MAX_IDLE_TIME * 60) { 
$count++; 
} 
} 
closedir($directory_handle); 
return $count; 
} else { 
return false; 
} 
} 
?

 

Then to display the numbers online you would use

 

<?php
echo 'Number of online users: ' . getOnlineUsers() . '<br />';
?>

Jiblix where should I put the code since I don't have access to the file where x website is. What program should I use becuase I don't have access to that file in other words is not my website is any website I search with a browser.

 

is firebug ok then where should I save this file?

 

Thanks you!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.