Suyakukd
02-10-2008, 13:16
Dưới đây là bản ERC kiểm soát số trang xem trong một giây (nhìn giống HVA)
Và đây là bản thử nghiệm với chức năng yêu cầu xác nhận nếu số vượt số request cho phép trong một giây.
(Nhìn bên ngoài giống cách các anh HVA, còn bên trong thì mình không biết )
http://xforce.enhack.net/showthread.php?p=961#post961
<?php
$ban = 1;
$in = (ip2long($_SERVER['REMOTE_ADDR']) + time())."\n";
$log = fopen('erc.log','a'); fwrite($log, $in); fclose($log);
$list = file('erc.log',FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$last = count($list) - 1;
if($last) {
if( ($list[$last] - $list[$last - 1]) != 0 ) $ban = 0;
}
if($ban) {
echo "<html>
<head>
<meta http-equiv=Content-Type content=text/html; charset=utf-8 />
<title>:: Thông báo từ Server ::</title>
<style type='text/css' id='vbulletin_css'>
body
{
background: #DCDCB7;
color: #4d4d4d;
font: 8pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
margin: 0px;
padding: 0px;
MARGIN-TOP: 10px;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-RIGHT: 0px;
}
input.btn{
color:#e1e1e1;
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:84%;
font-weight:bold;
background-color:#8E4C08;
border:1px solid;
border-top-color:#EEEEE0;
border-left-color:#EEEEE0;
border-right-color:#EEEEE0;
border-bottom-color:#EEEEE0;
}
</style>
</head>
<body>
<table border=0 height=500 width=100%>
<tr>
<td align='center' valign='middle'>
<p align='center'>Bạn có tốc độ đọc siêu phàm, bạn đã vượt quá số trang được xem trong một giây, vui lòng click <b>Continue</b> để tiếp tục</p>
<form name=enter method=POST action='".$_SERVER['REQUEST_URI']."'>
<input type=submit value='Continue' size=6 name='***' class='btn'>
</form>
</td>
</tr>
</table>
</body>
</html>";
exit;
}
if($last > 15) unlink('erc.log');
$ban = 1;
?>
Và đây là bản thử nghiệm với chức năng yêu cầu xác nhận nếu số vượt số request cho phép trong một giây.
(Nhìn bên ngoài giống cách các anh HVA, còn bên trong thì mình không biết )
http://xforce.enhack.net/showthread.php?p=961#post961
<?php
$ban = 1;
$in = (ip2long($_SERVER['REMOTE_ADDR']) + time())."\n";
$log = fopen('erc.log','a'); fwrite($log, $in); fclose($log);
$list = file('erc.log',FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$last = count($list) - 1;
if($last) {
if( ($list[$last] - $list[$last - 1]) != 0 ) $ban = 0;
}
if($ban) {
echo "<html>
<head>
<meta http-equiv=Content-Type content=text/html; charset=utf-8 />
<title>:: Thông báo từ Server ::</title>
<style type='text/css' id='vbulletin_css'>
body
{
background: #DCDCB7;
color: #4d4d4d;
font: 8pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
margin: 0px;
padding: 0px;
MARGIN-TOP: 10px;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-RIGHT: 0px;
}
input.btn{
color:#e1e1e1;
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:84%;
font-weight:bold;
background-color:#8E4C08;
border:1px solid;
border-top-color:#EEEEE0;
border-left-color:#EEEEE0;
border-right-color:#EEEEE0;
border-bottom-color:#EEEEE0;
}
</style>
</head>
<body>
<table border=0 height=500 width=100%>
<tr>
<td align='center' valign='middle'>
<p align='center'>Bạn có tốc độ đọc siêu phàm, bạn đã vượt quá số trang được xem trong một giây, vui lòng click <b>Continue</b> để tiếp tục</p>
<form name=enter method=POST action='".$_SERVER['REQUEST_URI']."'>
<input type=submit value='Continue' size=6 name='***' class='btn'>
</form>
</td>
</tr>
</table>
</body>
</html>";
exit;
}
if($last > 15) unlink('erc.log');
$ban = 1;
?>