aoming认为到目前为止,问题已有明确答案,本贴已被冻结,不再接受更多的回复 把数字换成图片显示
<html> <head> <title>访客计数器</title> <style type="text/css"> <!-- .STYLE1 { font-size: 36px; color: #FF0000; } --> </style> </head> <body> <div align="center"> <p> <?php $counterfile = "./count/count.txt"; function dispcounter($counterfile) { $fp = fopen($counterfile,"rw"); global $num; $num = fgets($fp,5); $num +=1; //echo "您是第".$num."位到访的客人"; exec("del $counterfile"); exec("echo $num > $counterfile"); }
if(!file_exists($counterfile)) { exec("echo 0 > $counterfile"); } dispcounter($counterfile); echo "<p>"; ?> <? $row = strlen($num); for($i=0;$i<$row;$i++) { $image = substr($num,$i,1); $str .="<img src=\"image/$image.gif\" width=\"10\" height=\"10\">"; }
?>
<span class="STYLE1"> <img src="image/bsd.JPG" width="81" height="83">计数器</span> </p> <p> </p> <p>开站至今已有<? echo $str ?>人访问本站</p> </div> </body> </html>
|