At such times your statistical system (probably quantum, Baidu, etc.) is not statistically. However, we can use some anti-attack software to achieve, 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 continuously refresh the page 5 times will point to the native http://127.0.0.1
Copy the 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 the user's reply:
The SESSION relies on cookies, what if I block the cookie?
TCP/IP-Apache-PHP This process has consumed a lot of things, to this step just no more computational operations and MySQL connections
With these lines of code, the problem cannot be solved. At most, for those in the browser to press F5 Brush page operation.
So we recommend that the server install anti-CC attack firewall effect will be better. You can go to s.jb51.net to see the relevant software.
The above describes the anti-CC attack PHP anti-CC attack implementation code, including anti-CC attacks on the content, I hope the PHP tutorial interested in a friend helpful.