亚洲啪啪,久久精品一区二区日本,欧美字幕一区,日韩AV高清在线观看

中山php|最優(yōu)網(wǎng)絡(luò)中山做網(wǎng)站 中山php建站

最優(yōu)良人

2013/03/29 at 18:55

php防止刷流量攻擊

<?php
//查詢禁止IP
$ip =$_SERVER['REMOTE_ADDR'];
$fileht=".htaccess2";
if(!file_exists($fileht))file_put_contents($fileht,"");
$filehtarr=@file($fileht);
if(in_array($ip."\r\n",$filehtarr))die("Warning:"."<br>"."Your IP address are forbided by some reason, IF you have any question Pls emill to shop@mydalle.com!");

//加入禁止IP
$time=time();
$fileforbid="log/forbidchk.dat";
if(file_exists($fileforbid))
{ if($time-filemtime($fileforbid)>60)unlink($fileforbid);
else{
$fileforbidarr=@file($fileforbid);
if($ip==substr($fileforbidarr[0],0,strlen($ip)))
{
if($time-substr($fileforbidarr[1],0,strlen($time))>600)unlink($fileforbid);
elseif($fileforbidarr[2]>600){file_put_contents($fileht,$ip."\r\n",FILE_APPEND);unlink($fileforbid);}
else{$fileforbidarr[2]++;file_put_contents($fileforbid,$fileforbidarr);}
}
}
}
//防刷新
$str="";
$file="log/ipdate.dat";
if(!file_exists("log")&&!is_dir("log"))mkdir("log",0777);
if(!file_exists($file))file_put_contents($file,"");
$allowTime = 120;//防刷新時(shí)間
$allowNum=10;//防刷新次數(shù)
$uri=$_SERVER['REQUEST_URI'];
$checkip=md5($ip);
$checkuri=md5($uri);
$yesno=true;
$ipdate=@file($file);
foreach($ipdate as $k=>$v)
{ $iptem=substr($v,0,32);
$uritem=substr($v,32,32);
$timetem=substr($v,64,10);
$numtem=substr($v,74);
if($time-$timetem<$allowTime){
if($iptem!=$checkip)$str.=$v;
else{
$yesno=false;
if($uritem!=$checkuri)$str.=$iptem.$checkuri.$time."1\r\n";
elseif($numtem<$allowNum)$str.=$iptem.$uritem.$timetem.($numtem+1)."\r\n";
else
{
if(!file_exists($fileforbid)){$addforbidarr=array($ip."\r\n",time()."\r\n",1);file_put_contents($fileforbid,$addforbidarr);}
file_put_contents("log/forbided_ip.log",$ip."--".date("Y-m-d H:i:s",time())."--".$uri."\r\n",FILE_APPEND);
$timepass=$timetem+$allowTime-$time;
die("Warning:"."<br>"."Sorry,you are forbided by refreshing frequently too much, Pls wait for ".$timepass." seconds to continue!");
}
}
}
}
if($yesno) $str.=$checkip.$checkuri.$time."1\r\n";
file_put_contents($file,$str);

-
久久久88久久久| 下一页 一区 欧美| 欧美性一区人妻| 欧美,日韩,国产,无码| 日本免费三级片久久久| 欧美精品一区二区三区潮喷b2| 免费看b 国产| 啊 好爽 视频| 国产AV色婷婷五月天| 精品无码中文区| 成年精品成人久久久久| 欧美人妻五月天一区二区| 日本亚洲国产精品| 成仁精品8| 亚洲国产综合久久久| 日本人妻3电影在线播放| 通江县| 日本一区二区三区con高清视频| 大吊欧美视频| 麻豆一区二区五区| 欧美色激情视频1区2区| 亚洲一二三不卡免费视频| 午夜激情福利网站| 91日韩精品| 超碰 国产 亚洲 欧美| 欧美亚洲 日韩成年人小说 | 久久精品一区二区三区蜜臀| 黄色仓库永久免费| 美女被操欧美毛蕉| 亚洲A午夜成人| 顶级少妇后入人妻| 欧美国产一区二区三区五月| 日韩 国产 av 亚洲| 人妻丝袜一区二区| 欧美一区二区三区高清视频| 豆花AV 一区二区三区| 国产久久久久香蕉动漫黄色成人视频| 人人人人人人人人人人人| 亚洲天堂无码久| 18禁一区二区九久视频| 亚洲社区男人的天堂|