1

Using Cakephp 2.2.4 and the Recaptcha plugin 1.1 from CakeDC on a form. The page is SSL/HTTPS. When I submit form with correct recaptcha text entered the form resets and no messages.

have checked $this->request->data in the appropriate method in controller and no post is received by it.

Anyone come across this problem or have a solution ?

Thanks.

Extract from Controller code:

if ($this->request->is('post')) {   
                if ($this->Recaptcha->verify()) {

Extract from View:

echo $this->BootstrapForm->input('message', array(
                                    'type' => 'textarea', 
                'required' => 'required',
                'helpInline' => '<span class="label label-important">' . __('Required') . '</span>&nbsp;')
            );

            ?>
                            <?php echo $this->Recaptcha->display(array('recaptchaOptions'=>array('theme' => 'clean'))); ?>    
            <?php echo $this->BootstrapForm->submit(__('Submit'),array('class' => 'btn btn-primary'));?>
        </fieldset>
    <?php echo $this->BootstrapForm->end();?>

Have made no changes to model for recaptcha.

CakeDC plugin I am using is this one:

https://github.com/CakeDC/recaptcha

Chuck Burgess
  • 11,600
  • 5
  • 41
  • 74
Softinio
  • 638
  • 1
  • 6
  • 19
  • Looks like this a problem with Recaptcha over SSL as I used the Google Recaptcha PHP Library directly in my app instead of using the plugin and I am getting the same problem. Any suggestions welcome else going to have to find an alternative. – Softinio Jan 25 '13 at 19:48

1 Answers1

0

See the SSL part here.

reCAPTCHA on an https site

In order to avoid getting browser warnings when you use reCAPTCHA on an SSL site, you should replace http://www.google.com/recaptcha/api with https://www.google.com/recaptcha/api when you request a challenge. Your request to reCAPTCHA would look like this:

<script type="text/javascript"
   src="https://www.google.com/recaptcha/api/challenge?k=your_public_key">
</script>

<noscript>
   <iframe src="https://www.google.com/recaptcha/api/noscript?k=your_public_key"
       height="300" width="500" frameborder="0"></iframe><br>
   <textarea name="recaptcha_challenge_field" rows="3" cols="40">
   </textarea>
   <input type="hidden" name="recaptcha_response_field"
       value="manual_challenge">
</noscript>
floriank
  • 25,546
  • 9
  • 42
  • 66