This time in the statistical tool always see some unknown browsers, unknown operating system users frequent requests and IP are in a paragraph, so I have some doubt, these users are effective users. Web Access no browser no operating system records, I after a few days of analysis to confirm that these visits are not people in the access but some machines or others in the collection of my station, the initiation of a kind of shielding the idea of this IP.
The statistics inside the browser has not recorded the user data export to see the next screen IP has not been realistic IP many more than 100, but carefully watch it is not difficult to see that these IP are concentrated in some IP break. Think of a way to screen the entire IP segment users, may cause some manslaughter but to ensure that the site traffic is clean.
Okay, I'm not talking about it. Here is a description of my implementation and the implementation of the Code
I wanted to. Shielding the front ends of the IP segment 111.11.11.11 This IP I'm going to shield with 111.11 of the beginning of this IP segment of the access
My idea is to put the IP set to be screened in an array and then use the obtained user's IP to go to the array match, in the array of shielding is not in the array to release.
Serve it. One of the very rough functions I've written. Don't spray.
/**
* Shielded IP segment
*
/function Killip ($IP) {
$return = false;
$ip 1 = Array (' n ', ' 112 ', ' 102 ', ' 114 ');
$ip 2 = Array (' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ');
$temp = Explode ('. ', $ip);
if (In_array ($temp [0], $ip 1) && In_array ($temp [1], $ip 2)) {
$return = true;
}
return $return;
The above mentioned is the entire content of this article, I hope you can enjoy.