色老二精品视频在线观看,69视频福利一区二区三区,免费无遮挡很爽很污很黄的网站,欧美女人一级黄色录像,亚州精品毛片一区区三区

24小時(shí)熱線電話: 贛州網(wǎng)站建設(shè),贛州網(wǎng)絡(luò)公司,贛州做網(wǎng)站,贛州網(wǎng)站建設(shè)價(jià)格,贛州網(wǎng)頁制作,贛州建網(wǎng)站公司,贛州微信二維碼平臺,贛州微信公眾號,贛州百度公司,贛州百度推廣,贛州百度優(yōu)化,贛州朝揚(yáng)網(wǎng)絡(luò),朝揚(yáng)網(wǎng)絡(luò)

熱線:0797-8296060

QQ咨 詢?nèi)肟?/a> 稍后再說 立 即咨詢
  • 0797-8296060
  • 掃一掃 公眾號
您當(dāng)前所在位置 : 首頁   »  新聞動(dòng)態(tài)  »  建站常識

建站常識

朝揚(yáng)解讀前沿 資訊,分享互聯(lián)網(wǎng)時(shí)代精英智慧

php防止刷流量攻擊

發(fā)布時(shí)間:2018-01-17 作者: 來源: http://www.yqhuitong.cn/ 瀏覽:

<?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);


贛州網(wǎng)站建設(shè)|贛州網(wǎng)絡(luò)公司|贛州做網(wǎng)站|贛州網(wǎng)站建設(shè)價(jià)格|贛州網(wǎng)頁制作|贛州建網(wǎng)站公司|贛州微信二維碼平臺|贛州微信公眾號|贛州百度公|贛州百度推廣|贛州百度優(yōu)化|贛州朝揚(yáng)網(wǎng)絡(luò)|朝揚(yáng)網(wǎng)絡(luò)

贛州朝揚(yáng)網(wǎng)絡(luò)科技有限公司

贛州朝揚(yáng)一部:贛州市章貢區(qū)富升大廈1604室??? 贛州朝揚(yáng)二部:贛州市安虔路22號A棟(203)

備案號:贛ICP備15004771號

贛公網(wǎng)安備 36070202000138號