<select> based CAPTCHA ?

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 22nd, 2009, 1:33 am

What do you think about this ?

HTML Code: [ Select ]
<?php
   session_start();
   if( ! @$_SESSION['reason'])
   {
      $_SESSION['reason'] = rand(1,5);
   }
   
   if( ! empty($_POST['submit']))
   {
      echo @$_POST['reason'] == $_SESSION['reason'] ? 'success' : 'fail';
      do_on_success();
   }
   
   $opts = array(1 => 'first', 'second', 'third', 'fourth', 'fifth');
?>
<form action="test.php" method="post">
<select name="reason">
   <option value="1">select</option>
   <option value="2">the</option>
   <option value="3"><?php echo $opts[$_SESSION['reason']]; ?></option>
   <option value="4">option</option>
   <option value="5">please</option>
</select>
<input type="submit" name="submit" />
</form>
  1. <?php
  2.    session_start();
  3.    if( ! @$_SESSION['reason'])
  4.    {
  5.       $_SESSION['reason'] = rand(1,5);
  6.    }
  7.    
  8.    if( ! empty($_POST['submit']))
  9.    {
  10.       echo @$_POST['reason'] == $_SESSION['reason'] ? 'success' : 'fail';
  11.       do_on_success();
  12.    }
  13.    
  14.    $opts = array(1 => 'first', 'second', 'third', 'fourth', 'fifth');
  15. ?>
  16. <form action="test.php" method="post">
  17. <select name="reason">
  18.    <option value="1">select</option>
  19.    <option value="2">the</option>
  20.    <option value="3"><?php echo $opts[$_SESSION['reason']]; ?></option>
  21.    <option value="4">option</option>
  22.    <option value="5">please</option>
  23. </select>
  24. <input type="submit" name="submit" />
  25. </form>
Strong with this one, the sudo is.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 22nd, 2009, 1:33 am

  • trevHCS
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 14, 2005
  • Posts: 34
  • Loc: NW England, UK
  • Status: Offline

Post October 22nd, 2009, 8:49 am

Interesting approach and pretty universal assuming people can count. Only thing is, wouldn't it be better to have the text above the selection box telling them which one to select, then just have the list of options below, eg:


Please select the fifth option from the list below.

[LISTBOX]
Option 1
Option 2
Option 3
Option 4
Option 5
[/LISTBOX]

Would still be hard for bots and actually possibly harder as in HTML the instruction and the actual box would be further apart. Can't imagine anyone programming a bot specifically to work this out anyway.

Of course if you really wanted to get clever, you could use something like animal names in there or well anything else, but I guess that requires a little more intelligence from the public and I never too convinced that exists... :)

Trev
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Joined: Dec 29, 2003
  • Posts: 5169
  • Loc: SC-USA
  • Status: Offline

Post October 22nd, 2009, 8:52 am

This seems similar to the practice of having the user respond to a mathematical operation, for example "Human verification: What is 2 + 4? <input>"

Is there a reason this would be more or less efficient?
- dM
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 22nd, 2009, 9:15 am

I don't know about efficient, but it's not something I've seen used before. Which means it would be impervious to spam bots that aren't specifically designed with a certain site in mind, at least for a little while.

I use a similar thing on my contact form, basically I have a reasons <select> element with random options that say "I want to send you spam" mixed in with the real answers. I drop submissions that don't use one of the real options. Since I started using it my spam almost vanished, at least for the time being. :)
Strong with this one, the sudo is.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: Zealous and 203 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.