Просмотр файла online.php

Размер файла: 1.08Kb
<? define("DATA_MAIN", true); ?>
<?
header("Content-type: text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
print "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
print "<wml>";
print "<card id=\"index\" title=\"OnLine\">";
print "<p align=\"left\"><small>";

include ("inc.php");

echo "<b>Список мобил в OnLine:</b><br/>";

$soft=htmlspecialchars($HTTP_USER_AGENT);
$time=time();
$time_off=time()+120;
$onl=mysql_fetch_row(mysql_query("select time from online where soft='$soft';"));
if (!$onl[0]){mysql_query("insert into online values ('$soft','$time_off');");};
if ($onl[0]){mysql_query("update online set time='$time_off' where soft='$soft';");};
$cl_onl=mysql_query("delete from online where time<'$time';");

$onl=mysql_query("select * from online");
while ($res=mysql_fetch_row($onl)){
$mob=strtok($res[0],'/');
$diff=120-($res[1]-time());
echo "$mob [$diff сек.]<br/>";};
echo "<a href=\"index.php\">&#8592; В гостевую</a>";
echo '</small></p></card></wml>';
?>