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.















I believe you know that this hack is mentioned on this page under the title Online Marketing Tips Blog
http://www.7cmarketing.com/index.html
However it does not work on Blogger blogs. I’ve tried to include the code in a widget and on the template. The widget does nothing, and Blogger erases the code when we save the template. I have just replaced the IP array address with my own to try. I can’t copy it in here because it is not accepted in the comment.
Do you have any idea on what is wrong, please? Thanks.
No, it is not going to work on Blogger blogs, hosted by Blogger, or on any free web hosting that is not going to allow you to run scripts.
This will only work on sites where you host your blog, as I do, on a web host that does offer you these facilities.
Thank you very much Pamela. I guessed there was a reason, ofcourse, but I didn’t think of this one.
May I ask something else, please?
I have had a blog hosted at another place before, but presently I do not wish to publish my blogs anywhere else. Is there any possible way to host a file with the PHP code in another host that accepts PHP and make it work with the blog, either with links or else? Sorry to bother you, I do not pretend to abuse, it is just that I am very much interested. Thanks again.
Well, yes, technically, I can think of a method (maybe someone knows another), but you wouldn’t want to try this at home, believe me.
There are certainly better ways of doing it through the .htaccess but that, again, is a facility that you don’t have at Blogger.
OK, because Blogger does allow Javascript in your blog template, you could put some Javascript code that specifies that visitors must visit from a certain address. That address, would, of course, be the page on the site elsewhere that accepts PHP and where you have the blocking script code. There, nice people can be allowed through to your blog (by link or redirect) and all hackers and abusers can be sent off to Disney or wherever.
BUT … this would be an extremely horrible user experience for genuine readers of your blog, because no matter what link they followed, they would keep getting bounced to that off-blog script, that then takes them back to the front page of the blog and not to the actual link / post they wanted.
It would also be absolutely useless, because while most ordinary visitors have Javascript enabled in their browsers and would have to go through this fiasco, most hackers and undesirables will be using bots and other programs that do not use and can easily get around Javascript.
No, I really don’t think this is possible, on a practical basis, unless you’re prepared to move the blogs to a fully-featured web host.
Oh, genuine questions are never abuse, so please, ask as many as you want.
You are really super kind and I won’t go on exploiting your kindness. from what I understand I better give up the idea owing to the exposed reasons.
Thank you very much again, and have a nice time.
Yes, you understand perfectly - unless you had wanted to move the blogs.
Incidentally, while I can’t write in Portuguese, puedo hacerlo en español, si es de ayuda.
And please, don’t hesitate to ask whatever questions you wish.
Thanks for the post. I’m gonna try it.