geht das, Leute??
Bin da nämlich durch zufall auf folgendes script gestoßen:
UserOnline:
// Schreiben des Eintrags in eine Tabelle...
$database= "";
$sqlhost= "";
$sqluser= "";
$sqlpass= "";
mysql_connect($sqlhost,$sqluser,$sqlpass) OR DIE( "Couldn't connect to MySQL server!");
mysql_select_db($database) OR DIE( "Couldn't select database!");
$logtab = "userlog";
$time = explode( " ", microtime());
$userusec = (double)$time[0];
$usersec = (double)$time[1];
$User_Id = $usersec + $userusec;
$IP = getenv(REMOTE_ADDR);
$logtab = "userlog";
$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("Unable to query my-db!");
}
$resultlogtab = mysql_query("SELECT Count(*) as total FROM $logtab");
$numberlogtab = mysql_fetch_array($resultlogtab);
// Hier wird die Anzahl der User ausgegeben...
if ($numberlogtab[total] != ""){
print "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\">
<BR>$numberlogtab[total] User online</font>";
}
?>
Geht das ohne DB auch??
Bin da nämlich durch zufall auf folgendes script gestoßen:
UserOnline:
// Schreiben des Eintrags in eine Tabelle...
$database= "";
$sqlhost= "";
$sqluser= "";
$sqlpass= "";
mysql_connect($sqlhost,$sqluser,$sqlpass) OR DIE( "Couldn't connect to MySQL server!");
mysql_select_db($database) OR DIE( "Couldn't select database!");
$logtab = "userlog";
$time = explode( " ", microtime());
$userusec = (double)$time[0];
$usersec = (double)$time[1];
$User_Id = $usersec + $userusec;
$IP = getenv(REMOTE_ADDR);
$logtab = "userlog";
$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("Unable to query my-db!");
}
$resultlogtab = mysql_query("SELECT Count(*) as total FROM $logtab");
$numberlogtab = mysql_fetch_array($resultlogtab);
// Hier wird die Anzahl der User ausgegeben...
if ($numberlogtab[total] != ""){
print "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\">
<BR>$numberlogtab[total] User online</font>";
}
?>
Geht das ohne DB auch??
Kommentar