Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Development (http://www.go4expert.com/articles/web-development/)
-   -   Prevent Spam Using Invisible CAPTCHA (http://www.go4expert.com/articles/prevent-spam-using-invisible-captcha-t28714/)

pradeep 11Jul2012 19:29

Prevent Spam Using Invisible CAPTCHA
 
All of us have often encountered a "human" validation on various sites known as CAPTCHA, these are intended for bots - automatic programs - which crawl through websites and make comments, fill up contact forms etc. with the intention of marketing products, gaining backlinks, etc.

The general approach is to implement an image based CAPTCHA where distorted alphanumeric characters are shown which the user needs to identify and enter into a text box, many CAPTCHA systems provide audible CAPTCHA for the visually impaired, an example of a very popular 3rd party CAPTCHA plugin provider is reCAPTCHA.

Honeypot CAPTCHA



Honeypot CAPTCHA is a very simple & novel idea to prevent spam bots, it is not at all a new idea, it's been around for a long time but has not been very popular, I guess mostly because like all systems it has it's drawbacks, but here let's leave aside the drawbacks and see the simplicity of the idea and ease with which this can be implemented.

The idea behind is to have a field which is not visible on browsers but it'll be visible to bots and the bots will try to fill them and in the form processing back-end a check needs to be enforced that the 'invisible' field should always be empty. A normal human user wouldn't see the field and won't fill it, to hide the field from users we can use CSS, follow the the HTML example:

HTML Code:

<html>
 <head>
  <title>Honeypot CAPTCHA</title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="Pradeep">
  <style type="text/css">
  .honeypot {
    display: none;
  }
  </style>
 </head>

 <body>
  <form method="POST" action="mailer.php">
    Name : <input type="text" name="uName"><br/>
    Email : <input type="text" name="uEmail"><br/>
    Comment : <input type="text" name="Comment"><br/>
    <div class="honeypot"><input type="text" name="TheFieldThatShouldBeBlank"></div>
    <input type="submit" value="Post Comment">
  </form>
 </body>
</html>

Here, the invisible field will not be visible to a human user, the back-end script should have a checking something similar to the following:

Code: PHP

<?php

// check for honeypot
if(!empty($_POST['TheFieldThatShouldBeBlank'])) {
    header('Location: error.php');
    exit;
}

// normal processing
?>


Drawbacks



This field might be visible on screen readers used by the visually impaired, it'll pose a problem for them and for people whose browsers don't have CSS support. This kind of spam prevention technique is not safe from playback spamming.

sheridudly 24Jul2012 15:23

Re: Prevent Spam Using Invisible CAPTCHA
 
Really it's very much useful to prevent spam. Even many of the forums are using this invisible captcha. When we are typing the word/letters are not visible to us until we select the word or letters...

vaayaaedu 2Sep2012 07:56

Re: Prevent Spam Using Invisible CAPTCHA
 
captcha is not stopping spamming. I still receive junk mails even after using captcha. But it have reduced spam mails.

Webdeveloper 6Sep2012 17:26

Re: Prevent Spam Using Invisible CAPTCHA
 
Very right! To some extent CAPTCHA for sure assists in dealing with spam bots activities on a respective website. Even-though, understanding distorted characters may bring your brain out, CAPTCHA surely assists in bringing down spam ratio. Honey Pot CAPTCHA or invisible CAPTCHA is also a very good strategy to protect your website.


All times are GMT +5.5. The time now is 08:29.