add captcha to external form

Hi there

After testing around for a while, I reached the point to ask you guys.

How the hack can I add a captcha validation to an external form?

$captcha = Loader::helper('validation/captcha');
<?php $captcha->display(); ?>
<?php $captcha->showInput(); ?>

This adds the Captcha. Great. But how to validate it?

In the Controller
$captcha = Loader::helper('validation/captcha');
echo "captcha: " . $captcha->check($_REQUEST['ccmCaptchaCode']);

This returns nothing. The Captcha is never validated...

Thanks a lot.

View Replies: View Best Answer
hutman replied on at Permalink Best Answer Reply
You should just need this in your controller

if (!$captcha->check()) {
     //error stuff goes here

It will find the correct captcha stuff in the post information and validate it.
Steff replied on at Permalink Reply
There must have been a typing error or somethink like this.

Thanks huntman. It works like a charm.
Khurramali replied on at Permalink Reply
Thanks for sharing. This really helped.