Home Backend Development PHP Tutorial PHP-系统流量分析的程序_PHP

PHP-系统流量分析的程序_PHP

Jun 01, 2016 pm 12:36 PM
class echo analyze flow program system

>create table stream (
ip text,
sTime int,
visits int,
info text);

if($day $mlink=mysql_connect('localhost','ajax','xxxxxxx');
//统计至今首页被浏览的总次数
$query="select SUM(visits) as tvisits from stream";
$result=mysql_db_query('ajax',$query,$mlink);

echo '浏览首页总累积次数:';
if($row=mysql_fetch_object($result)){
echo $row->tvisits;
}

$week=array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
for($i=0;$i echo '

';
$ctime1=time()-24*3600*$i;
$ctime2=time()-24*3600*($i-1);
echo '日期:'.date("m月d日",$ctime1).$week[date("w",$ctime1)];
echo "
";

$stoday1=mktime(0,0,0,date(m,$ctime1),date(d,$ctime1),date(Y,$ctime1));
$stoday2=mktime(0,0,0,date(m,$ctime2),date(d,$ctime2),date(Y,$ctime2));
//统计当日首页被浏览的累积次数
$query='select SUM(visits) as tvisits from stream where sTime>=';
$query.=$stoday1.' and sTime $result=mysql_db_query('ajax',$query,$mlink);
echo '浏览首页累积次数:';
if($row=mysql_fetch_object($result)){
echo $row->tvisits;
}
//统计当日拜访ip的数量
$query='select * from stream where sTime>='.$stoday1;
$query.=' and sTime $result=mysql_db_query('ajax',$query,$mlink);

echo "
浏览总人数:".mysql_num_rows($result);
echo '


';
echo '';
echo '


';
echo "";

while($row=mysql_fetch_object($result)){
echo '';
echo '';
echo '';
echo '';
echo '';
echo " ";
}
echo "
IP位址 最近时间 次数 用户资讯
'.$row->ip.''.date("h:i:sa",$row->sTime).''.$row->visits.''.$row->info.'
";
echo '
';
}
mysql_close($mlink);
?>

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to make Google Maps the default map in iPhone How to make Google Maps the default map in iPhone Apr 17, 2024 pm 07:34 PM

How to make Google Maps the default map in iPhone

CUDA's universal matrix multiplication: from entry to proficiency! CUDA's universal matrix multiplication: from entry to proficiency! Mar 25, 2024 pm 12:30 PM

CUDA's universal matrix multiplication: from entry to proficiency!

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Jul 30, 2024 pm 02:17 PM

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time

Clock app missing in iPhone: How to fix it Clock app missing in iPhone: How to fix it May 03, 2024 pm 09:19 PM

Clock app missing in iPhone: How to fix it

Which version of Apple 16 system is the best? Which version of Apple 16 system is the best? Mar 08, 2024 pm 05:16 PM

Which version of Apple 16 system is the best?

Can't allow access to camera and microphone in iPhone Can't allow access to camera and microphone in iPhone Apr 23, 2024 am 11:13 AM

Can't allow access to camera and microphone in iPhone

Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Jun 02, 2024 pm 02:58 PM

Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use

How to check data usage on Xiaomi Mi 14Pro? How to check data usage on Xiaomi Mi 14Pro? Mar 18, 2024 pm 09:04 PM

How to check data usage on Xiaomi Mi 14Pro?

See all articles