View Single Post
Old 04-19-2005, 01:24 AM   #8 (permalink)
CreativeLogic
The Acquainted
 
Join Date: Mar 2005
Posts: 177
Thanks: 0
CreativeLogic is on a distinguished road
Default

This is untested but it should work.
online.php
Code:
// delete old visitors
$timeout = time() - 60 * 5; // 5 minutes
mysql_query("DELETE * FROM sessions WHERE lastvisit < $timeout");

// update user
mysql_query("REPLACE INTO sessions SET lastvisit = '" . time() . "'");

// query users
$thisdomainquery = mysql_query("SELECT COUNT(*) AS totalusers FROM sessions");
$thisdomain = mssql_fetch_array($thisdomainquery);

// will output users on this site
echo $thisdomain['totalusers']; 

// pull info from other sites
// this will pull the info from the other domains with each new line as an array element
$network = file('http://www.anotherdomain.com/online.php'); 
$networktotal += $network[0];

// add the above two lines for all the sites you wish

Last edited by CreativeLogic : 04-19-2005 at 04:25 PM.
CreativeLogic is offline  
Reply With Quote