<span class="unnamed3"> <br>require (’common.inc’); <br>$ip=$REMOTE_ADDR; <br>$current=getdate(time()); <br>$day=$current["mday"]; <br>$query="select * from count"; <br>$result=mysql_db_query(’football’,$query,$link); <br>while($row=mysql_fetch_row($result)) <br>{ <br>$num=$row[2]; <br>if (strcmp($ip,$row[0])==0 && $day==$row[1]) <br>{ <br>$i=1; <br>} <br>} <br>if ($i1) <br>{ <br>++$num; <br>echo "你是第" .$num; <br>echo "访问者"; <br>$query1="insert into count values (’$ip’,$day,$num)"; <br>mysql_db_query(’football’,$query1,$link); <br>} <br>else <br>{ <br>echo "你是第" .$num; <br>echo "访问者"; <br>} <br>?> <br><br>common.inc: <br> <br>$arr_request=array(); <br>if (count($HTTP_GET_VARS)) <br>{ <br>while (list($key,$value)=each($HTTP_GET_VARS)) <br>{ <br>$arr_request[strtolower($key)]=$value; <br>} <br>} <br>if (count($HTTP_POST_VARS)) <br>{ <br>WHILE (list($key,$value)=each($HTTP_POST_VARS)) <br>{ <br>$arr_request[strtolower($key)]=$value; <br>} <br>} <br>$link=mysql_connect("localhost","root",""); <br>?> <br><br>库为: <br>football <br>表: <br>count <br>字段:ip->char(20) <br>day->int(2) <br>num->int(8) <br>这个程序稍加修改就可成为多用户记数器,而且不能作假哟! <br>仅作个人用</span> <p style="width:100%;text-align:center;margin:10px 0"> <br> <br> </p> <p style="width:100%;text-align:center;margin:10px 0"> </p> <p class="clear"></p>