Prevent Spam Using Invisible CAPTCHA

Discussion in 'Web Development' started by pradeep, Jul 11, 2012.

  1. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    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:
    <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:

    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.
     
  2. sheridudly

    sheridudly New Member

    Joined:
    Jul 24, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Civil Engineer
    Location:
    Stephenville, TX
    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...
     
  3. vaayaaedu

    vaayaaedu Banned

    Joined:
    Aug 16, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://www.vaayaaedu.com/
    captcha is not stopping spamming. I still receive junk mails even after using captcha. But it have reduced spam mails.
     
  4. Webdeveloper

    Webdeveloper New Member

    Joined:
    Jun 22, 2011
    Messages:
    28
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    IT Professional
    Location:
    New Delhi
    Home Page:
    http://www.lexolutionit.com
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice