php统计静态html页面浏览访问次数代码
count.php
<?php
$aid = isset($_GET['aid']) ? $_GET['aid'] : '';
$t = isset($_GET['t']) ? $_GET['t'] : '';
if (intval($aid)) {
if ($t == 'show') {
echo "document.write('120');";
} else {
$conn = mysql_connect('www.phprm.com', 'root', 'root');
$sql = "Update test set click_num = click_num+1 where aid ='$aid'";
mysql_db_query('db', $sql, $conn);
}
}html代码
<script language="javascript教程" src="count.php?aid=5&t=show"></script> 显示浏览次数
<script language="javascript" src="count.php?aid=5"></script> 增加浏览次数
我们只要把这段代码放到html页面,再把当前html 页面的id给aid就行了,这样你的静态页面的访问次数你也可以把握知道了哦。
本文链接:http://www.phprm.com/code/33457.html
收藏随意^^请保留教程地址.