Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CodeIgniter中的recaptcha安装问题_Codeigniter_Recaptcha - Fatal编程技术网

CodeIgniter中的recaptcha安装问题

CodeIgniter中的recaptcha安装问题,codeigniter,recaptcha,Codeigniter,Recaptcha,我尝试在我的Codeigniter应用程序中实现recaptcha,但它抛出了一个错误 我已加载我的助手: $this->load->helper('recaptchalib_helper'); 我的控制器: $publickey = $this->config->item('recaptchakey'); $data['recaptchakey'] = $publickey; $return = recaptcha_check_answer($publickey, $

我尝试在我的Codeigniter应用程序中实现recaptcha,但它抛出了一个错误

我已加载我的助手:

$this->load->helper('recaptchalib_helper');
我的控制器:

$publickey = $this->config->item('recaptchakey');
$data['recaptchakey'] = $publickey;
$return = recaptcha_check_answer($publickey, $_SERVER["REMOTE_ADDR"], $this->input->post("recaptcha_challenge_field"), $this->input->post("recaptcha_response_field"));

if($this->form_validation->run() == FALSE){
   $this->load->view('form', $data);
} else {            
   if(!$return->is_valid) {
      echo 'failed';
      $this->load->view('form', $data);
} else {
      echo 'success';
      $this->load->view('form', $data);
}

反复出现的错误是“无效的站点私钥”和“不正确的验证码”-有人能告诉我哪里出了问题吗?提前感谢。

无效的站点私钥与您在配置文件中输入的数据有关。请在此处阅读更多信息:

不正确的验证码sol
与构建视图的方式有关。阅读更多: