<?php
global $ip, $sess_id, $sql, $count_online, $time;
$minustime=$time-300;
$reqip=$sql->q("DELETE FROM `online` WHERE `ip`='$ip' ");
$reqsess=$sql->q("DELETE FROM `online` WHERE `sess`='$sess_id' ");
$reqsess=$sql->q("DELETE FROM `online` WHERE `time`<$minustime ");
$reqins=$sql->q("INSERT INTO `online`(`ip`,`sess`,`time`) VALUES('$ip','$sess_id','$time') ");
$count_online=$sql->nr("SELECT * FROM `online`");
?>