Greetings,
I have an Add-On development question. I’m pretty new at this, as you can probably tell…
I’ve posted to ExpressionEngine Answers here… http://expressionengine.stackexchange.com/questions/11313/how-can-i-use-a-captcha-in-a-form-that-is-not-an-add-on
I’ve created a basic Exp Eng add-on module that creates a form on the page and displays the captcha. Currently I’m using the reCAPTCHA add-on from Brandon Jones (if he’s here in the forums maybe he can help) and it successfully displays on the page. I’m assuming if that extension were un-installed that it would also successfully display the built-in Exp Eng Captcha instead, but I’ve not tested that.
$data_raw = preg_replace("/{captcha}/", $this->EE->functions->create_captcha(), $data_raw);The problem is that I don’t know how to validate the submitted captcha from the form. Whatever anyone types in the google captcha box is accepted and never validated.
I would prefer to use Exp Eng itself to run the validation. The idea being that whatever captcha code is in place my form could still validate it using Exp Eng. Is there a library or set of functions I can tap into (similar to create_captcha used above)?
I know how to run a jquery function upon submission of a form to do validation. But so far in php is seems you have to replace the form action to run a function that does the validation and then code the resulting actions in php. The form needs to post to a service on another server so I don’t see how I can replace the form action. How do you call a validation function that is part of another installed Exp Eng add-on, or is there a way to do that?
Thanks, Bob
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.