无为清净楼资源网 Design By www.qnjia.com
可以实现在线人数统计,日访问量统计,月访问量统计。。。。。
<?
$sql = "CREATE TABLE guestinfo(id integer DEFAULT '0' NOT NULL AUTO_INCREMENT,
ipaddress varchar(20),
host varchar(20),
cometime datetime,
refreshtime datetime,
leavetime datetime,
PRIMARY KEY(id),
UNIQUE id(id),
index guestinfo(id)
)";
mysql_query($sql, $connect);
?>
<?
$duration = 300;
$sql = "select * from guestinfo where (leavetime is null or leavetime='') and ( UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(refreshtime))>$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");
<head>
<meta http-equiv="Refresh" content=<? echo $duration?>; url=<? echo $PHP_SELF; ?>">
</head>
欢迎来我的网站来灌水,有什么问题,给我留言。
<?
$sql = "CREATE TABLE guestinfo(id integer DEFAULT '0' NOT NULL AUTO_INCREMENT,
ipaddress varchar(20),
host varchar(20),
cometime datetime,
refreshtime datetime,
leavetime datetime,
PRIMARY KEY(id),
UNIQUE id(id),
index guestinfo(id)
)";
mysql_query($sql, $connect);
?>
<?
$duration = 300;
$sql = "select * from guestinfo where (leavetime is null or leavetime='') and ( UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(refreshtime))>$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");
<head>
<meta http-equiv="Refresh" content=<? echo $duration?>; url=<? echo $PHP_SELF; ?>">
</head>
欢迎来我的网站来灌水,有什么问题,给我留言。
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年11月15日
2024年11月15日
- 群星.2002-恋爱物语情歌对唱精选2CD(引进版)【滚石】【WAV+CUE】
- 群星《闽南情24K德国HD金碟》2CD[WAV+CUE]
- 周传雄《恋人创世纪》环球唱片[WAV+CUE]
- 关淑怡-《真假情话K2HD》(日本压制)【WAV+CUE】
- 王菲 -《Faye Wong》雨果LPCD45 [WAV+分轨][1G]
- 陈百强《世纪10星·永恒篇》环球[WAV+CUE][1G]
- 陈奕迅《黑·白·灰》台湾版[WAV+CUE][400M]
- 张尕怂.2024-甘肃娃娃【FLAC分轨】
- 张惠妹.2011-A.MEI.ACOUSTIC.BEST.2CD【丰华】【WAV+CUE】
- ZEN.1996-珍惜所有【华纳】【WAV+CUE】
- 群星《环球国语元素》香港首版[WAV+CUE][1G]
- 周慧敏《玉女天后》原音母版1:1直刻[WAV+CUE][1G]
- 谭咏麟《20世纪中华歌坛名人百集珍藏版》[WAV+CUE][1G]
- 炉石传说40轮盘术最新卡组代码在哪找 标准40轮盘术卡组代码分享
- 炉石传说亲王贼怎么玩 2024亲王贼最新卡组代码分享