以下就是--------------&#62;&#62;&#62;&#62;&#62;&#62;&#62;&#62;&#62;&#62;&#62;&#62;<BR>
#!/usr/bin/perl<BR>
<BR>
$limit=600; #ip锁定时间(秒)<BR>
$newid=1; #是否允许建立新的ID,不允许则设为0;<BR>
$url='count/'; #设置存放记录的目录 <BR>
<BR>
$online=1;<BR>
<BR>
######处理环境参数<BR>
$buffer=$ENV{'QUERY_STRING'};<BR>
<a href=/cgi-bin/msgForm.cgi?sid=BqgS4mHTm_ZEK_v_44BfZ1!/4qf!4qm!qq/!qfQ3_H4T/BPmTqY/41444Ef/mf/4i_!4fH!mf4&to=@pairs&folder=new&lang2=gb&addr=1>@pairs</a> = split(/&/, $buffer);<BR>
<BR>
foreach $pair (<a href=/cgi-bin/msgForm.cgi?sid=BqgS4mHTm_ZEK_v_44BfZ1!/4qf!4qm!qq/!qfQ3_H4T/BPmTqY/41444Ef/mf/4i_!4fH!mf4&to=@pairs&folder=new&lang2=gb&addr=1>@pairs</a>
{<BR>
($name, $value) = split(/=/, $pair);<BR>
$value =~ tr/+/ /;<BR>
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;<BR>
$A{$name} = $value;}<BR>
<BR>
######处理环境参数<BR>
<BR>
$countrecord="$url$A{'ID'}_count.dat"; #设置计数器文件<BR>
$iprecord="$url$A{'ID'}_iprecord.txt"; #设置ip lock记录文件<BR>
<BR>
#$ip="$url$A{'B'}_ip.txt"; #设置 ip 记录文件--(备用)<BR>
# &checkrecord; check record file --(备用)<BR>
<BR>
<BR>
###### IP LOCK #######<BR>
($sec,$min,$hour,$mday,$mon,$year)=localtime(time); <BR>
$mon=$mon+1;<BR>
$year=$year+1900;<BR>
<BR>
open(re_count,"$countrecord");<BR>
$count=&#60;re_count&#62;;<BR>
close(re_count);<BR>
<BR>
if(&iplock){<BR>
goto dsp;}<BR>
###### IP LOCK #####<BR>
<BR>
$count++;<BR>
open(wr_count,"&#62;$countrecord");<BR>
print wr_count "$count"; <BR>
close(wr_count);<BR>
<BR>
dsp: # display the count.<BR>
<BR>
print"Content-type:text/html/n/n";<BR>
<BR>
if ($A{'SHOW'} eq 'count'){<BR>
print "document.write('访问人数:&#60;font color=red&#62;'+$count+'&#60;/font&#62;');"; }<BR>
<BR>
if ($A{'SHOW'} eq 'online'){<BR>
print "document.write('当前在线:&#60;font color=red&#62;'+$online+'&#60;/font&#62;人');"; }<BR>
<BR>
if ($A{'SHOW'} eq 'online|count'){<BR>
print "document.write('访问人数:&#60;font color=red&#62;'+$count+'&#60;/font&#62;&#60;br&#62;当前在线:&#60;font color=red&#62;'+$online+'&#60;/font&#62;人');"; }<BR>
<BR>
exit 0;<BR>
<BR>
###### CHECK IP sub #####<BR>
sub iplock{<BR>
$check=0;<BR>
open (FILE,"$iprecord");<BR>
<a href=/cgi-bin/msgForm.cgi?sid=BqgS4mHTm_ZEK_v_44BfZ1!/4qf!4qm!qq/!qfQ3_H4T/BPmTqY/41444Ef/mf/4i_!4fH!mf4&to=@LINES=&#60;FILE&#62;;&folder=new&lang2=gb&addr=1>@LINES=&#60;FILE&#62;;</a> <BR>
close(FILE);<BR>
<a href=/cgi-bin/msgForm.cgi?sid=BqgS4mHTm_ZEK_v_44BfZ1!/4qf!4qm!qq/!qfQ3_H4T/BPmTqY/41444Ef/mf/4i_!4fH!mf4&to=$SIZE=@LINES;&folder=new&lang2=gb&addr=1>$SIZE=@LINES;</a> <BR>
<BR>
open (FILE,"&#62;$iprecord");<BR>
for ($i=0;$i&#60;$SIZE;$i++){<BR>
$_=$LINES[$i];<BR>
($addr,$come_hour,$come_min,$come_sec,$come_time)=split(/,/,$_);<BR>
$flag=($hour-$come_hour)*3600+($min-$come_min)*60+($sec-$come_sec);<BR>
<BR>
if( $addr eq "$ENV{'REMOTE_ADDR'}" ){<BR>
print FILE "$ENV{'REMOTE_ADDR'},$hour,$min,$sec,$come_time/n";<BR>
$check=1;<BR>
}<BR>
<BR>
elsif ($flag &#60; $limit && $flag &#62; 0) {<BR>
print FILE $_;<BR>
$online++;<BR>
}<BR>
}#end for <BR>
<BR>
if ($check == 0){<BR>
print FILE "$ENV{'REMOTE_ADDR'},$hour,$min,$sec,$hour:$min:$sec/n";<BR>
close (FILE);<BR>
return 0;<BR>
}<BR>
return 1;<BR>
close (FILE); <BR>
}<BR>
<BR>
<BR>
<BR>
###### check record file ########<BR>
sub checkrecord{<BR>
<BR>
if ($newid && ( !(-e $countrecord) ) ){<BR>
open (FILE,"&#62;$countrecord");<BR>
print FILE 0;<BR>
close(FILE);<BR>
<BR>
open (FILE,"&#62;$iprecord");<BR>
close(FILE);}<BR>
<BR>
<BR>
}#end sub<BR>
<BR>
&#60;&#60;&#60;&#60;&#60;&#60;&#60;&#60;&#60;&#60;&#60;&#60;&#60;---------------ok,完毕!<BR>