Easy way to stop spam

Hi all,

Quite an innovative and easy way to stop spam I have seen today on forms on a site.

Underneath the form, put a tick box and tell the person to tick the box before sending - stops many spambots :)

Cheers
 

ThomasHardy

Free Member
Jan 24, 2008
280
21
Have you thought about using CAPTCHA instead?

I use it on my websites, but I personally hate the whole thing, especially the use of CAPTCHA on UKreg's login page. It takes me around 3 or 4 goes to login because the image is so hard to read, even for humans!

Yeah I try to avoid it, hence why I use the invisible field or a random maths question.

Here is the invisible field one, or inverse CAPTCHA
 
  • Like
Reactions: sm1
Upvote 0

ThomasHardy

Free Member
Jan 24, 2008
280
21
If you have an invisible field don't you run the risk of Google thinking that it's hidden text, and banning you? (Link)
Which would certainly reduce spam....

Yeah I know, but this is just a field with a smidgen of text no links or keywords. I am yet to test and I wouldn't risk it on my clients site due to the reason above but it is defiantly worth a try.

There's absolutely no reason why the google bot should be scanning a form, right?

Google scan everything!
 
  • Like
Reactions: sm1
Upvote 0
Google scan everything!

You've heard of robots.txt, right?

Especially given google's innovative idea of crapping on your site:
Specifically, when we encounter a <FORM> element on a high-quality site, we might choose to do a small number of queries using the form. For text boxes, our computers automatically choose words from the site that has the form; for select menus, check boxes, and radio buttons on the form, we choose from among the values of the HTML. Having chosen the values for each input, we generate and then try to crawl URLs that correspond to a possible query a user may have made. If we ascertain that the web page resulting from our query is valid, interesting, and includes content not in our index, we may include it in our index much as we would include any other web page.
 
  • Like
Reactions: sm1
Upvote 0
I usually just do this with a question as part of the form - rather than the simple checkbox, which is easy for a spammer to script into the attack.

Something like "What colour is an orange?" , and the form input validates to all lower-case, so you check that the value is "orange" then process the form.

The hidden input form method is dead easy, in the form you have
Code:
   <input style='visibility: none;' name='anti_spam' value='' type='text'/>
and then in your form processing you just do (in PHP)

Code:
 if ($_REQUEST["anti_spam"]=="") {
  [continue processing]
}

That'll do it.
 
  • Like
Reactions: sm1
Upvote 0

Tim R-T-C

Free Member
Mar 19, 2008
548
64
The North
Google do not punish all hidden text AFAIK - afterall a lot of websites use it to hide spoliers for film plots etc.

I personally dislike the CAPTCHA approach - my wife who has dyslexia finds them impossible to use and many of them look very unprofessional. A hidden field like the one mentioned here would be ideal, but probably unlikely to last too long before it is cracked.
 
  • Like
Reactions: sm1
Upvote 0
Yeah, I'm not a great fan of the hidden form field one myself - but another commenter was asking how to do it, so I put it in...

For myself, I tend to use the 'What colour is an orange' type question/answer method, and the sites I use it on haven't been spammed in up to five years of operation now. I also did a database version where you'd got any number of questions (and could change/edit them easily) so that it pulled the question at random.

At that point, a hidden field in the form contained the question id, so that when the form was processed, it could check for the answer of question [x], make sure it was correct, and then process the rest of the form.

All the questions were similar formats - what colour is black? which is larger, an elephant or a mouse? what weighs more, a feather or a jumbo jet? what is 2+2? - and if necessary contained alternative answers (the 2+2 one in particular needs a check for 'four' as well as '4' ) - and so far hasn't been spammed at all, despite being on a site getting thousands of hits a day.

So that tends to be what I use. It's certainly far more user-friendly than a Captcha - and more accessible too. :)
 
  • Like
Reactions: sm1
Upvote 0

Latest Articles

Join UK Business Forums for free business advice