CakePHP Recaptcha使用CakeDC插件版本1.1没有收到控制器方法的帖子没有错误信息

时间:2013-01-21 13:48:59

标签: cakephp cakephp-2.1 recaptcha cakedc

在CakeDC上使用Cakephp 2.2.4和Recaptcha插件1.1。该页面是SSL / HTTPS。当我提交表格并输入正确的重新填写文本时,表单将重置并且不会显示任何消息。

已在控制器中的相应方法中检查了$ this-> request->数据,并且未收到任何帖子。

有人遇到过这个问题或有解决方案吗?

感谢。

从Controller代码中提取:

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

从视图中提取:

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();?>

没有对recaptcha的模型进行任何更改。

我正在使用的CakeDC插件就是这个:

https://github.com/CakeDC/recaptcha

1 个答案:

答案 0 :(得分:0)

See the SSL part here

  

https网站上的reCAPTCHA

     

为了避免在使用reCAPTCHA时出现浏览器警告   在SSL网站上,您应该替换http://www.google.com/recaptcha/api   当您请求时,请https://www.google.com/recaptcha/api   挑战。您对reCAPTCHA的请求如下所示:

<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>