?
$duration = 300;
$sql = "SELECT * from Guestinfo where (Leavetime are null or leavetime= ') and (Unix_timestamp (now ())-unix_timestamp (REFR eshtime)) > $duration ";
$result = @mysql_query ($sql);
while ($row = @mysql_fetch_array ($result))
{
$id = $row [' id '];
$sql = "Update guestinfo set Leavetime=now () where id= ' $id '";
mysql_query ($sql);
}
$sql = "SELECT * from Guestinfo where ipaddress= ' $REMOTE _addr ' and (Leavetime is null or leavetime= ')";
$result = @mysql_query ($sql);
if ($row = @mysql_fetch_array ($result))
{
$id = $row [' id '];
$sql = "Update guestinfo set Refreshtime=now () where id= ' $id '";
mysql_query ($sql);
}
Else
{
$sql = "INSERT into Guestinfo (ipaddress,host,cometime,refreshtime)
VALUES (' $REMOTE _addr ', ' $REMOTE _host ', now (), now ()) ";
mysql_query ($sql);
}
$date = Mktime (0,0,0,date ("M"), Date ("D"), Date ("Y"));
$sql = "SELECT count (*) from Guestinfo where Unix_timestamp (refreshtime) > $date";
$result = mysql_query ($sql);
if ($result)
{
$row = Mysql_fetch_array ($result);
$todayaccess = $row ["Count (*)]";
}
else $todayaccess = 0;
$sql = "SELECT count (*) from guestinfo where leavetime is null or leavetime= '";
$result = mysql_query ($sql);
if ($result)
{
$row = Mysql_fetch_array ($result);
$nowonline = $row ["Count (*)]";
}
else $nowonline = 0;
Mysql_close ($connect);
?>
Include ("guest.php");
<meta http-equiv= "Refresh" CONTENT=<? Echo $duration?>; url=<? echo $PHP _self?> ">
Welcome to my website to irrigation, what is the problem, give me a message.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.