hmm, virker vist ikke for godt......her er en som jeg fandt her på eksperten, den bruger mysql database:
<?php
/*
CREATE TABLE userlog (
id2 int(11) DEFAULT \'0\' NOT NULL auto_increment,
ID char(255),
IP char(255),
NAME char(255),
COUNT char(255),
DATE char(255),
PRIMARY KEY (id2)
);
*/
$database= \"database\";
$table= \"userlog\";
$sqlhost= \"localhost\";
$sqluser= \"password\";
$sqlpass= \"username\";
mysql_connect($sqlhost,$sqluser,$sqlpass) OR DIE( \"Couldn\'t connect to MySQL server!\");
mysql_select_db($database) OR DIE( \"Couldn\'t select database!\");
$IP=$REMOTE_ADDR;
$HOST= gethostbyaddr($IP);
$time= explode( \" \", microtime());
$userusec= (double)$time[0];
$usersec= (double)$time[1];
$deleteuser= mysql_query( \"delete from userlog where DATE < $usersec -300\");
$userlog= mysql_fetch_row(MYSQL_QUERY( \"SELECT * FROM userlog where IP like \'$IP\'\"));
if($userlog == false)
{
$ok= @mysql_query( \"insert INTO userlog (ID,IP,NAME,DATE) VALUES(\'$User_Id\',\'$IP\',\'$HOST\',\'$usersec\')\")or die( \"Unable to query
db!\");
}
$resultlogtab = mysql_query( \"SELECT Count(*) as total FROM userlog\");
$numberlogtab = mysql_fetch_array($resultlogtab);
print \"<p align=\"center\"><font color=\"#FFFFFF\">$numberlogtab[total] User online!</font></p>\";
?>
tjek ellers:
http://www.eksperten.dk/find.phtml?q=online%20phpsom giver dig en del resultater, der er helt sikkert en du kan bruge...