Formmail, recaptcha, and custom error page

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am attempting to add recaptcha to a formmail script. I have a working
test at:

The test page is static HTML, and the final production form will be, too.
No PHP or such. PHP is available on the server, however.

In the same directory I have custom error and success pages (static HTML)
that are in keeping with the site design. The success page is working, but
the error page is only half working as desired.

Currently -- and feel free to play with the test form to confirm this --
leaving any required field blank takes the visitor to my custom error page
as intended. However, entering incorrect but non-null recaptcha data takes
the visitor to the default recaptcha error page.

Apparently this behavior is set by lines 384-388 of the host-provided
formmail. The original is and (with my private key
added) is in my Apache docroot; a copy (sans private key and with the file
extension changed so as to be viewable) is here:

I've searched this group, looked at, and googled, but
haven't found anything I can work with. Presumably this is a trivial
change to make for someone who knows what he's doing, but unfortunately
that's not me. Can anyone help me understand what to replace this code
Warren Post
Santa Rosa de Copán, Honduras /

[SOLVED] Re: Formmail, recaptcha, and custom error page

On Fri, 12 Mar 2010 17:03:42 -0600, Warren Post wrote:

Quoted text here. Click to load it

Answering my own question here, but for the sake of any future searcher
looking for the solution, here's what I was told on another NG:

At line 331, replace:

     if (($error eq 'missing_fields') &&
         ($CONFIG =~ m#https?://.+\..+#)) {


     if ( ( ($error eq 'missing_fields')
            || ($error eq 'bad_recaptcha_response') ) &&
           ($CONFIG =~ m#https?://.+\..+#)
         ) {


Works great.
Warren Post
Santa Rosa de Copán, Honduras /

Site Timeline