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; } ?> 在主頁(yè)上適當(dāng)位置放置代碼<? include "count1.php" ?>,這樣主頁(yè)上就顯示了你的計(jì)數(shù)器,不過(guò)要記住在你的數(shù)據(jù)庫(kù)上建立一個(gè)TABLE——counter:create table counter( num int unsigned, visited int unsigned ); 怎么樣,容易吧!中篇我將介紹怎樣讓你的鏡像站也能用上你自己的計(jì)數(shù)器。