forked from modi1231/DIC_Text_Based_Mafia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Usersonline.php
35 lines (30 loc) · 952 Bytes
/
Usersonline.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php require("Left.php"); ?>
<html>
<head>
</head>
<body>
<table width="90%" height="94" border="0" cellpadding="0" cellspacing="2" class="table">
<tr>
<td height="23" align="center" class="header">Users online</td>
</tr>
<tr>
<td class="cell"><?php
$sql = "SELECT name FROM users WHERE DATE_SUB(NOW(),INTERVAL 5 MINUTE) <= lastactive ORDER BY id ASC"; // Searches the database for every one who has being last active in the last 5 minute
$query = mysql_query($sql) or die(mysql_error());
$count = mysql_num_rows($query);
$i = 1;
while($row = mysql_fetch_object($query)) {
$online_name = htmlspecialchars($row->name);
echo "<a href=\"View_Profile.php?name=". $online_name ."\" onFocus=\"if(this.blur)this.blur()\">".$online_name."</a>";
if($i != $count) {
echo "<label> - </label>";
}
$i++;
}
echo "<p><center>Total Online: ".$count."</center></p>";
?></td>
</tr>
</table>
</body>
</html>
<?php require("Right.php"); ?>