I was wondering if anyone out there successfully integrated reCatcha on a form that was running through Form Tools (
http://www.formtools.org ) on a MODx site.
I've successfully integrated Form Tools many times with MODx and it works great but this is the first time I've tried adding reCaptcha.
The problem is that, as part of the install, I'm required to add this to the top of the page:
<?php
require_once("../form/global/api/api.php");
ft_api_start_sessions();
$fields = isset($_SESSION["form_tools_form_data"]) ?
ft_strip_tags($_SESSION["form_tools_form_data"]) : array();
...which I've done through a snippet. Unfortunately, when I do, I get an error message that reads:
Warning: require_once(../path/to/formtools/global/api/api.php) [function.require-once]: failed to open stream: No such file or directory in /home/example/domains/example.com/public_html/core/cache/includes/elements/modsnippet/31.include.cache.php on line 7
Fatal error: require_once() [function.require]: Failed opening required '../formtools/global/api/api.php' (include_path='.:/usr/local/lib/php') in /home/example/domains/example.com/public_html/core/cache/includes/elements/modsnippet/31.include.cache.php on line 7
That api,php file, by the way,
is on the server.
Not sure if it matters, it happens whether the site is running with user friendly URLs or not.
I tried emptying site cache (deleting contents of core/cache) and made sure it is writable.
Not that it matters, but I tried just adding the reCaptcha call (through a snippet) just before the submit button, which looks like this:
<?php
ft_api_display_captcha();
and it results in this error message:
Fatal error: Call to undefined function ft_api_display_captcha() in /home/example/domains/example.com/public_html/core/cache/includes/elements/modsnippet/32.include.cache.php on line 7
I tried adding another snippet to the page...one that I had made...just to see if it was a problem with the page handling snippets, but it ran okay. It seems to be something with the reCaptcha code.
Yes, I've tried looking through the Form Tools forums, etc but I didn't find anything useful. I think I need an answer that is more MODx specific.
Thank you in advance.
MODx 2.2.1
PHP Version 5.2.10
[ed. note: waizen last edited this post 14 years, 5 months ago.]