>create table stream (
ip text,
stime int,
visits int,
info text);
<?
if($day<0)$day=0;
$mlink=mysql_connect(‘localhost’,’ajax’,’xxxxxxx’);
//统计至今首页被浏览的总次数
$query=”lect sum(visits传媒大学有哪些) as tvisits from stream”;
$result=mysql_db_query(‘ajax’,$query,$mlink);
echo ‘高尔基的童年全文<span class=”st1″>浏览首页总累积次数:’;
if($row=mysql_fetch_object($result)){
echo $row->tvisits;
}
$week=array(“星期日”,”星期一”,”星期二”,”星期三”,”星期四”,”星期五”,”星期六”);
for($i=0;$i<=$day;$i++){
echo ‘<p>’;
$ctime1=time()-24*3600*$i;
$ctime2=time()-24*3600*($i-1);
echo ‘<span class=”st4″>日期:’.date(“m月d日”,$ctime1).$week[date(“w”,$ctime1)];
echo “</span>”;
$stoday1=mktime(0,0,0,date(m,$ctime1),date(d,$ctime1),date(y,$ctime1));
$st糖果恶霸oday2=mktime(0,0,0,date(m,$ctime2),date(d,$ctime2),date(y,$ctime2));
//统计当日首页被浏览的累积次数
$query=’lect sum(visits) as tvisits from stream where stime>=’;
$query.=$stoday1.’ and stime<‘.$stoday2;
$result=mysql_db_query(‘ajax’,$query,$mlink);
echo ‘<span class=”st3″>浏览首页累积次数:’;
if($row=mysql_fetch_object($resual是什么学校ult)){
echo $row->tvisits;
}
//统计当日拜访ip的数量
$query=’lect * from stream where stime>=’.$stoday1;
$query.=’ and stime<‘.$stoday2.’ order by stime desc’;
$result=mysql_db_query(‘ajax’,$query,$mlink);
echo ”
浏览总人数:”.mysql_num_rows($result);
echo ‘</span><hr size=”1″>’;
echo ‘<table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”2″ class=”st3″>’;
echo ‘<tr><td nowrap class=”st2″>ip位址</td>
<td nowrap class=”st2″>最近时间</td>
<td nowrap class=”st2″>次数</td>
<td nowrap class=”st2″>用户资讯</td>’;
echo “</tr>”;
while($row=mysql_fetch_object($result)){
echo ‘<tr>’;
echo ‘<td nowrap>’.$row->ip.'</td>’;
echo ‘<td nowrap>’.date(“h:i:sa”,$row->stime).'</td>’;
echo ‘<td nowrap>’.$row->visits.'</td>’;
echo ‘<td nowrap>’.$row->info.'</td>’;
echo ̶没有彩虹的阳光0;</tr> “;
}
echo “</table>”;
echo ‘<hr size=”1″>’;
}
mysql_clo($mlink);
?>
本文发布于:2023-04-06 06:23:58,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/d61c9992a422f58dd56270a435b6d526.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:PHP系统流量分析的程序.doc
本文 PDF 下载地址:PHP系统流量分析的程序.pdf
留言与评论(共有 0 条评论) |