Change ReCaptcha Error Message

260 views
Skip to first unread message

kcelsi

unread,
Mar 22, 2014, 6:55:06 PM3/22/14
to reca...@googlegroups.com
Hello,
How do I change the message displayed when someone enters the incorrect reCaptcha?  Now it says incorrect-captcha-sol.  I want it to be something more user friendly like "You have entered the characters incorrectly.  Please try again."  I tried editing this code in the recaptchalib.php file:

 $recaptcha_response->error = 'Incorrect Captcha. Please enter the characters you see below.';

But this did not work.  Please help.  Thanks.

Keith Norris

unread,
Mar 28, 2014, 5:55:46 PM3/28/14
to reca...@googlegroups.com

As the programmer, you can identify the error and then output any error you wish. I would not recommend doing this by changing code in recaptchalib.php, however.

In your code, just detect the error with an if() and then echo whatever message you like:

   if( $recaptcha_response->error == 'incorrect-captcha-sol') {
      echo 'Incorrect Captcha. Please enter the characters you see below.';
   }


Reply all
Reply to author
Forward
0 new messages