2012-05-08 41 views
0

我已經嘗試在我的Codeigniter應用程序中實施recaptcha,但它引發了一個錯誤。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); 
} 

反覆出現的錯誤是「無效的站點 - 私鑰」和「不正確,驗證碼 - 溶膠」 - 可以有人告訴我我哪裏錯了?提前致謝。

回答