SearchRecent postsThe Random ToolboxDrupal 7 Setting up variables for use in a template (preprocess and process functions) Rendering Drupal 7 fields (the right way) Linux Secure Copy (scp) command Restrict Free Shipping in Magento Quickbooks Text Connection Ticket Cross-Site Request Forgery (CSRF) jQuery Events: MouseOver / MouseOut vs. MouseEnter / MouseLeave Monthly archive
|
Simple and Cool jQuery CAPTCHA Plugin - Real PersonSimply create a form as you normally would and include a text field to use for the real person verification. In this example, my field would have a class of "your-captcha". <script type="text/javascript"> $(function() { $('input.your-captcha').realperson(); }); </script> So after you have the front-end working, we need to verify that the code entered was correct. Use this: function rpHash($value) { $hash = 5381; $value = strtoupper($value); for($i = 0; $i < strlen($value); $i++) { $hash = (($hash << 5) + $hash) + ord(substr($value, $i)); } return $hash; } if (rpHash($_POST['realPerson']) == $_POST['realPersonHash']) { ... } For a stripped down example, go here: http://keith-wood.name/realPersonBasics.html For more detailed documentation, go to http://keith-wood.name/realPerson.html |