Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to disallow proxies and spambots from posting in my website. What is the best way to do so?

I've downloaded a blacklist and my first idea was to disable each of ips in my .htaccess file, but after downloading the list, I found out that it contained almost 9 million entries.

My other idea was to split each IP in 4 parts and do [1;4] successive SQL queries in my POST.

Yet if I could cache this values on memory, I could inexpensively check for them with something like (:200 (:188 (:10 (:42)))). Is this doable with PHP?

Thanks!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Have you thought about using a CAPTCHA such as reCAPTCHA? They seem to be the industry standard for avoiding non-humans to post and would be much simpler to implement than an IP filter of 9 million blacklisted IPs.

share|improve this answer
    
This approach could work against a spambot, but it wouldn't disallow regular users from using proxies –  user21690 Oct 9 '09 at 19:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.