Drupal 7 Draggable Captcha - a more friendly way to prevent Spam

By shane
Sun, 2014-12-28 18:50
Daily Dose of Drupal Episode #188

Share with Others

Note: This is episode 188 NOT 187 as stated in the video!

The Drupal 7 Draggable Captcha module is not like most captchas. A captcha is a way to catch or capture spam and prevent a bot from completing a form. This is one of the most widely used ways to prevent SPAM on a website. Drupal has many different types of captchas available and the Draggable Captcha is one of the more fun and easy ones.

Rather then having to try to decipher a complicated code or perform a match equation, you simple have to drag a correct image from the left side of the captcha to the placeholder on the right. It's incredibly simple and a lot less frustrating then the traditional image or text based captcha.

The Draggable Captcha module can easily be added to any form on your site and you can be off and running on preventing bots from completing your forms in just a few simple minutes.

Let us know what you think.

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 187 and we’re going to be going over the Draggable Captcha Module. Before we get started, I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to head on over to codekarate.com, check out all the other host that we have going on and look at the EBook and let us know what you think and if you have anything that you want to learn that we aren’t currently covering.

Before we get started with the Draggable Captcha Module you may want to look at episode number 70 where we cover the Captcha Module because the Captcha Module is a requirement of the Draggable Captcha Module. So we’ll go over briefly what the Captcha Module is here but if you want a little more in depth coverage you might want to watch that video.

So what is the Draggable Captcha Module? It’s simply a nicer version of the Captcha which if you know is simply or typically where you type in the characters and sometimes it’s hard to read what those characters are. This Draggable Captcha allows you to drag an image from one…from the left side over to the right side to select the correct image and based on that it tells that you are basically a human and not a bot.

So we’re going to go ahead and just see this in action so we’re going to head on over to our development site and ensure that we have the Captcha and the Draggable Captcha Module installed and working. As you can see we have the Captcha Module on and the Draggable Captcha Module on and we can click any of these configurable buttons that bring you to the same page and this is where you actually set up which forms you want the Captcha Module to display on.

So we select the default challenge type and then we select the forms that we want the challenge type to show up on. And there’s a couple of different options here that we can go through and we’re not going to go through all of these but you may want to actually see what this going to do before you actually try it out. So you can click on this example sub-tab up here and here it shows you the Math Question Captcha which is the default or it now shows the challenge Draggable Captchas. There’s the mini and there’s the regular size.

So as you can see if you drag it over it turns green if you get it right. If you get it wrong it turns red and this mini version does the same thing. So let’s go ahead and just test out by changing the default challenge type to Draggable Captcha and we’re just going to turn on the user login to use Draggable Captcha as well just to show how it works. And again you can go to the Episode 70 and see exactly what all these settings do in a little more detail.
So let’s go ahead and we click Save. So I am going to grab the URL here and open up a new window and you’ll see if I go to this /user page because it’s only on this specific form that the captcha is showing up. So in order to login I also have to complete the captcha.

So if I try to login without filling in the captcha it’s going to tell me I need to go ahead and fill that in. If I fill it in incorrectly it’s not going to let me log in but if I fill it n correctly then it will let me submit the form. And you may not want to do this obviously with the login form but with the password reset form or any of the other forms that you think are vulnerable to bots, you can use this captcha as it’s a nicer, easier to use captcha than just a standard one.

It does have a warning that it says…it’s probably not the most suitable for a highly secure forms because it’s not as secured as some of the other captchas out there but it is a good kind of first line of defense. So go ahead and give it a try and let me know what you think. Again check out codekarate.com, follow me on Twitter at smthomas3 and we’ll see you next time on the Daily Dose of Drupal. Good bye.