We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How to use Exp Eng captcha "system" in an add-on or custom form.

Development and Programming

R.K.Foster's avatar
R.K.Foster
138 posts
12 years ago
R.K.Foster's avatar R.K.Foster

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

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.