co.ador Posted May 11, 2010 Share Posted May 11, 2010 can you find out how many user online on any page trough firebug? I am talking on a page where I won't have access to the host server? Link to comment https://forums.phpfreaks.com/topic/201432-how-many-users-online-in-a-web-site/ Share on other sites More sharing options...
co.ador Posted May 11, 2010 Author Share Posted May 11, 2010 What actually meant if it is possible to find another webpage or website numbers of user online? Link to comment https://forums.phpfreaks.com/topic/201432-how-many-users-online-in-a-web-site/#findComment-1056831 Share on other sites More sharing options...
Jiblix Posted May 11, 2010 Share Posted May 11, 2010 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 />'; ?> Link to comment https://forums.phpfreaks.com/topic/201432-how-many-users-online-in-a-web-site/#findComment-1056841 Share on other sites More sharing options...
co.ador Posted May 11, 2010 Author Share Posted May 11, 2010 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! Link to comment https://forums.phpfreaks.com/topic/201432-how-many-users-online-in-a-web-site/#findComment-1056844 Share on other sites More sharing options...
Jiblix Posted May 11, 2010 Share Posted May 11, 2010 If you dont have access to the server, Im afraid you wont be able to save the script. Let alone operate it. Its been a while since I have used UNIX but I believe you would need 777 privelages to properly run the script without error. Sorry. Link to comment https://forums.phpfreaks.com/topic/201432-how-many-users-online-in-a-web-site/#findComment-1056848 Share on other sites More sharing options...
Cory94bailly Posted May 12, 2010 Share Posted May 12, 2010 What you're looking for is just not possible unless the site already has a "Users Online" script uploaded... Link to comment https://forums.phpfreaks.com/topic/201432-how-many-users-online-in-a-web-site/#findComment-1056862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.