Hi, ich brauche eine FUNKTIONIRENDEN Script, der anzeigt wie viele User online sind. Einen der leicht ist und geht.
Thx Benny
Thx Benny
<?php // Schreiben des Eintrags in eine Tabelle... include("../inc/db.inc.php"); mysql_connect($MySQL_Host,$MySQL_User,$MySQL_Pass) OR DIE( "Couldn't connect to MySQL server!"); mysql_select_db($MySQL_Data) OR DIE( "Couldn't select database!"); $logtab = "useronline"; $time = explode( " ", microtime()); $userusec = (double)$time[0]; $usersec = (double)$time[1]; $User_Id = $usersec + $userusec; $IP = getenv(REMOTE_ADDR); $HOST = gethostbyaddr($REMOTE_ADDR); $logtab = "useronline"; $userlog = ""; $deleteuser = mysql_query("delete from $logtab where DATE < $usersec -800"); $userlog = mysql_fetch_row(MYSQL_QUERY("SELECT * FROM $logtab where IP like '$IP'")); if ($userlog == false) { $ok = mysql_query("insert INTO $logtab (ID,IP,NAME,DATE) VALUES('$User_Id','$IP','$HOST','$usersec')") or die(mysql_error()); } $resultlogtab = mysql_query("SELECT Count(*) as total FROM $logtab"); $numberlogtab = mysql_fetch_array($resultlogtab); // Hier wird die Anzahl der User ausgegeben... print "<meta http-equiv='refresh' content='60'>"; print "<meta http-equiv='Pragma' content='no_cache'>"; if ($numberlogtab[total] != ""){ print "<table width='100%'><tr><td width='100%'><center>"; print "<font face=\"Comic Sans MS\" size=\"1\"> $numberlogtab[total] User online</font><br>"; print "</td></tr></table>"; mysql_close(); } ?>
Kommentar