It is common for people to want to block their IP Addresses and among the reasons normally given is, to prevent security audit that usually scans their IP address. In some instances, people misuse the system or scan the IP address of their proxy provider or ISP by mistake. If one did not ask for this scan they can prevent this occurrence permanently.

One can block their IP address by simply entering their IP address onto the databases that are offered by some sites. Other problems include scrapers, spammers as well as other scum artists that are on the internet. All of the above factors are known to affect people’s IP addresses and once an IP address is affected one can block it using relevant software. With some of the software on the internet it is fairly straight forward since all that one needs to do is to edit, copy and then paste a code into a PHP of the one they want to block. An example of how one can paste the PHP code is by using the below process.

$deny = array (”111.111.111″, “222.222.222″, “333.333.333″);
if (in_array ($_SERVER ['REMOTE_ADDR'], $deny)) {
header(”location: http://www.google.com/”);
exit();
} ?>

The above code is what one can use if they wish to block their IP Address using PHP. Basically, the code creates different IP addresses that one wants to block and then does checking on all the incoming addresses against the different IP addresses. If the address matches against the array’s value the function will not allow access using a redirect header going to the URL that has been specified. All these is done quietly and quickly.

Share and Enjoy: