2016-06-15 21 views
1

私はCodeIgniterプロジェクトでTank認証を使いたいのですが、CodeIgniterでBotdetect captchaの基本インストールを開始する必要があります。Codeigniter Botdetect/Tank-Auth Captcha 404 Nginxでは見つかりません

私はこのlinkのクイックスタートインストールガイドに従っています。

私はこの規定を実行しようとしています下回るここにあるアプリケーション/ビュー/ welcome_message.php、下に保存され、その上にビュー:

<?php 
    defined('BASEPATH') OR exit('No direct script access allowed'); 
?><!DOCTYPE html> 
<html lang="en"> 
    <head> 
     <meta charset="utf-8"> 
     <title>Welcome to CodeIgniter</title> 
     <link type="text/css" rel="Stylesheet" href="<?php echo CaptchaUrls::LayoutStylesheetUrl() ?>" /> 
    </head> 
    <body> 

     <?php echo $captchaHtml; ?> 
     <input type="text" name="CaptchaCode" id="CaptchaCode" value="" /> 
    </body> 
</html> 

と、対応するコントローラは、アプリケーション/コントローラ/ようこその下に保存されます.php、こちらも下回っ:

<?php 
    defined('BASEPATH') OR exit('No direct script access allowed'); 

    class Welcome extends CI_Controller { 

    public function __construct(){ 
     parent::__construct(); 
    } 
    public function index() // Your controller 
    { 
     // load the BotDetect Captcha library and set its parameter 
     $this->load->library('botdetect/BotDetectCaptcha', array(
      'captchaConfig' => 'ExampleCaptcha' 
     )); 

     // make Captcha Html accessible to View code 
     $data['captchaHtml'] = $this->botdetectcaptcha->Html(); 
     $this->load->view('welcome_message',$data); 
    } 
} 

私のブラウザ上で実行すると、これは私が受け取ったものです:

Captcha Page

私はBotDetectがセッションを使用していることを理解しており、必要な設定を修正することができ、セッションはそれぞれの実行時に "ci_sessions"で作成されています。

どのようにしてこの問題を解決し、BotDetect Captchaを読み込むことができますか?

答えて

1

"application/config/routes.php"ファイルのBotDetect Captchaリクエスト(Captchaイメージ、サウンド、リソースなど)に使用されるBotDetect Captchaルートを登録するのを忘れたようです。

以下の2点を確認してください。

1 -

$route['botdetect/captcha-handler'] = 'botdetect/captcha_handler/index'; 
あなたが「routes.phpの」ファイルにBotDetectキャプチャルートを登録していることを確認してください - あなたの「コントローラ」フォルダのニーズのを"/controllers/botdetect/Captcha_handler.php"ファイルを持っています

私はこれが役に立ちそうです。

+0

ありがとうございます:) –

関連する問題