CodeIgniter Forums

Full Version: Help with captcha
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I have a comments module and I want to add captcha to the comment form. I've seen a lot of examples but cant seem to get how to do it...

Could I pls get help with the correct codes to add to the comments_view, comments_model and comments_controller file to get the captcha to work. A solution will b well appreciated.

El Forum

If you download the recaptcha here:

You can add the recaptcha library as a helper. Rename it to recaptchalib_helper.php and put it in your helper folder.

Edit the recaptcha function with the pub key (which you need to request here -

function recaptcha_get_html ($pubkey = '{put your key in here}', $error = null, $use_ssl = false)

From there you just need to add:
echo recaptcha_get_html();

where you want the captcha displayed.

  var RecaptchaOptions = {
   theme : 'clean'
  //javascript end
        <label class="ipsField_title" for="display_name">
        <p class="ipsField_content">
            &lt;?php echo recaptcha_get_html(); ?&gt;