Файл: minichat_by_KoT/minichat_by_KoT/whois.php
Строк: 24
<?php
##########################################
# ~ Разработка отдельных модулей ~~~~~~~ #
# ~ и написание скриптов на php (c)KoT ~ #
# ~ ICQ: 7675072 ~~~~~~~~~~~~~~~~~~~~~~~ #
# ~ Site: 4atlove.ru ~~~~~~~~~~~~~~~~~~~ #
# ~ E-mail: notefree@bk.ru ~~~~~~~~~~~~~ #
##########################################
require 'sid.php';
header("Cache-Control: no-cache");
header('Content-Type:text/html; charset=UTF-8');
ob_start();
require'config.php';
$link = connect_db();
list($row, $id, $ps) = check_login($link);
include 'head.php';
$rm = (int)$_GET['rm'];
if (!ctype_digit($_GET['rm'])) { header('Location: index.php?isset=403'); die; }
$rooms = mysql_fetch_array(mysql_query("SELECT `name` FROM `rooms` WHERE `rm`='$rm'"));
echo $div1 . 'Кто в <b>' . $rooms['name'] . '</b>?' . $div5;
$whos = mysql_query("SELECT `user` FROM `users` WHERE `room` = '$rm' AND `onl` + 100 > '$time' ORDER BY `onl` DESC");
if (mysql_num_rows($whos) > 1) $zp = ', ';
else $zp = '';
echo $div3;
while ($who = mysql_fetch_assoc($whos)) {
echo col($who['user']) . $zp;
}
if (mysql_num_rows($whos) > 0) echo $div5;
echo $div3 . '<a href="room.php?rm='.$rm.'"><b>В комнату</b></a>' . $div5;
include 'foot.php';
ob_end_flush();
?>