mysql_select_db("yourname",$linkptr);
mysql_query("update counter
set visited=visited+1 where num=1",$linkptr);
$result=mysql_query("select visited
from counter where num=1",$linkptr);
list($counter)=mysql_fetch_row($result);
$counter=sprintf("%05d",$counter);
for($i=0;$i<5;$i++){
$tmpstr="<img src=img/".substr($counter,$i,1).".GIF >";
echo $tmpstr;
}
?>
在主页上适当位置放置代码<? include "count1.php" ?>,这样主页上就显示了你的计数器,不过要记住在你的数据库上建立一个TABLE——counter:create table counter(
num int unsigned,
visited int unsigned
);
怎么样,容易吧!中篇我将介绍怎样让你的镜像站也能用上你自己的计数器。
Copyright © 2019- huatuo7.cn 版权所有 湘ICP备2022005869号-9
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务