iK heb een online script maar als een gast op me site is weergeeft hij het goed aan.
Maar als de gast weggaat van me site staat hij er nog steeds.
Na een paar minten gaat hij wel weg
Hoe kan ik ervoor zorgen dat dat weggaat?
Online.php:
PHP
<?php
include 'inc/header.php';
online('1');
$online_query = mysql_query("SELECT * FROM `member_accounts` WHERE DATE_ADD(uLast, INTERVAL 150 SECOND) > NOW() AND uOnline = 1 ORDER BY `uLast` DESC") or trigger_error(mysql_error());
$online_queryl = mysql_query("SELECT * FROM `gast_online` WHERE DATE_ADD(uLast, INTERVAL 150 SECOND) > NOW() ORDER BY `uLast` DESC") or trigger_error(mysql_error());
if(mysql_num_rows($online_query) != 0 || mysql_num_rows($online_queryl) != 0)
{
echo '<table><tr><td><strong>Gebruikersnaam:</strong></td><td><strong>Laatst gezien:</strong></td><td><strong>Locatie:</strong></td></tr>';
while($online = mysql_fetch_assoc($online_query))
{
$sq = mysql_query("SELECT * FROM member_accounts WHERE uId = ".$online['uId']."") or die(mysql_error());
while($online2 = mysql_fetch_assoc($sq))
{
echo '<tr><td style="width: 150px;"><a href="profiel?id=' . htmlentities($online['uId']) . '"><span style="color:' . htmlentities($online2['uCol']) . ';font-weight: bold;width: 150px;">' . htmlentities($online2['uName']) . '</span></a></td><td>' . htmlentities($online['uLast']) . '</td><td><a href="
' . htmlentities($online['uPage']) . '
">' . htmlentities($online['uPage']) . '</a></td></tr>';
}
}
while($online = mysql_fetch_assoc($online_queryl))
{
echo'<tr><td style="width: 150px;"><em>Gast</em></td><td>' . htmlentities($online['uLast']) . '</td><td><a href="' . htmlentities($online['uPage']) . '">' . htmlentities($online['uPage']) . '</a></td></tr>';
}
echo '</table>';
}
include 'inc/footer.php';
?>
Toon Meer