首页 > 开发 > PHP > 正文

php统计静态html页面浏览访问次数代码

2024-05-04 21:58:33
字体:
来源:转载
供稿:网友

count.php,代码如下:

  1. $aid  = isset( $_GET['aid'] )?$_GET['aid']:''
  2. $t = isset( $_GET['t'] )?$_GET['t']:''
  3. ifintval$aid ) ) 
  4.  if$t =='show' ) 
  5.  { 
  6.   echo "document.write('120');"
  7.  } 
  8.  else 
  9.  { 
  10.   $conn = mysql_connect('www.Vevb.com','root','root') ;   
  11.   $sql = "Update test set click_num = click_num+1 where aid ='$aid'"
  12.   mysql_db_query('db',$sql,$conn); 
  13.  } 

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就行了,这样你的静态页面的访问次数你也可以把握知道了.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表