cancel
Showing results for 
Search instead for 
Did you mean: 

reCAPTCHA Help

reCAPTCHA Help

Hello All

 

Where I stand right now is: I have reCAPTCHA setup but not verifying (according to the reCAPTHCA Admin portion. I have it to where on click for the submit button it can say whether or not the reCAPTCHA check box has been selected or not but I don't know where to go from there. I am finding answers to my validation questions but not exactly what to do and where to put things. Hoping someone here can help me. 

 

I would like to have the verification done on the same page and not have to create one for the form action.

 

This is for the Contact page that magento has.

 

Thank you for any help.

2 REPLIES 2

Re: reCAPTCHA Help

I think I figured it out. If I did, and it appears to be working, I will make another comment explaining what I did.

Re: reCAPTCHA Help

What I did appears to not have worked. 

 

What I did was: in the Mage/contacts/controllers/IndexController.php file I added

 

$secretKey = "-My Secret reCaptcha Key-";
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha); $responseKeys = json_decode($response,true); try { if(intval($responseKeys["success"]) !== 1) { throw new Exception("Bot Detected"); } }

There is more in the try area for checks on empty form fields, which work. This bit that I have put in this comment is at the end of the try set before all of the mail template stuff happens.

 

What am I doing wrong or am I missing something..?