This time your statistical system (may be quantum, Baidu, etc.) of course is also not statistically. However, we can use some software to prevent attacks, but the effect is sometimes not obvious. Below I provide a section of PHP code, can play a certain anti-CC effect.
Main function: in 3 seconds to refresh the page continuously more than 5 times will point to the local http://127.0.0.1
Copy Code code as follows:
$P _s_t = $t _array[0] + $t _array[1];
$timestamp = time ();
Session_Start ();
$ll _nowtime = $timestamp;
if (session_is_registered (' Ll_lasttime ')) {
$ll _lasttime = $_session[' ll_lasttime '];
$ll _times = $_session[' ll_times '] + 1;
$_session[' ll_times ' = $ll _times;
}else{
$ll _lasttime = $ll _nowtime;
$ll _times = 1;
$_session[' ll_times ' = $ll _times;
$_session[' ll_lasttime ' = $ll _lasttime;
}
if (($ll _nowtime-$ll _lasttime) <3) {
if ($ll _times>=5) {
Header (sprintf ("Location:%s", ' http://127.0.0.1 '));
Exit
}
}else{
$ll _times = 0;
$_session[' ll_lasttime ' = $ll _nowtime;
$_session[' ll_times ' = $ll _times;
}
The following is a reply from a netizen:
The session is based on cookies, what if the cookie is blocked off?
TCP/IP-> Apache-> php This process has consumed a lot of things, to this step just no more computing operations and MySQL connection
With these lines of code, it does not solve the problem. At most for those in the browser to press the F5 Brush page operation off.
So we recommend that the server install anti-CC attack firewall effect will be better. You can go to s.jb51.net to view the relevant software.