« Save money and time DIY oatmeal packs | Main | Chicks adopted by Cat »

Uncategorized

How to Block IP Addresses with PHP

Monday, September 24, 2007 | Permalink |

New here? If you'd like to be notified of new content, simply subscribe to my RSS feed or sign up for email alerts. Thanks for visiting!

When will script kiddies get a life? It never ceases to amaze me that every time I attempt to make myself available to visitors, some moron immediately starts their devilish tinkering trying to spam and subvert forms on my sites.

For the past few days, someone in the Ukraine, according to the IP address, has been targeting the forms on one of my sites, subverting two levels of security and being a nuisance sending me multiple nonsensical emails.

So the next step was to try to block their IP from accessing the page.

In this instance, the form uses PHP to start with, so it made sense to use PHP to do the blocking also, so I went in search of some code that would do the job. I’ve now installed and tested this - it works - I blocked myself from the pages by temporarily adding my own IP address to the array.

This is also simple copy and paste stuff, is not reliant on a Javascript enabled browser (as some blocking scripts are), nor does it require SSI (as they otherwise do), nor tinkering with the .htaccess - in case your host does not support this. Whilst no method is absolutely foolproof, it will inconvenience them - hopefully enough for them to look elsewhere for a plaything.

How to Block IP Addresses with PHP

If you found something you like here, why not subscribe? Just enter your email address below:

Delivered by FeedBurner | Subscribe in a reader

7 Comments


« Save money and time DIY oatmeal packs | Main | Chicks adopted by Cat »

We Sponzurz

Your Ad Here
-->

Advertise Here
We know advertising

 

September 2007
M T W T F S S
« Aug   Oct »
 12
3456789
10111213141516
17181920212223
24252627282930

feeds

Find us at ...



Random Kittehz

Add yer furball here

Random Fudz

Share yer grub here

Please. Every little helps!

Pamela Heywood's Facebook profile Add to Technorati Favorites Join the Blue Ribbon Online Free Speech Campaign

Random Twitz

    Get free updates

    Enter your email address below:

    Delivered by FeedBurner, who won't send you any spam. Your email is safe.

    Archives