小编Unk*_*n3r的帖子

PHP中的防洪DDoS

<?php
if (!isset($_SESSION)) {
        session_start();
}
// anti flood protection
if($_SESSION['last_session_request'] > time() - 2){
        // users will be redirected to this page if it makes requests faster than 2 seconds
        header("location: http://www.example.com/403.html");
        exit;
}
$_SESSION['last_session_request'] = time();
?>
Run Code Online (Sandbox Code Playgroud)

我已经测试了这个脚本,因为你提高了第二个它会http://www.example.com/403.html毫无理由地继续重定向.

谁能告诉我为什么?

php ddos

1
推荐指数
1
解决办法
3万
查看次数

标签 统计

ddos ×1

php ×1