Note that there are some explanatory texts on larger screens.

plurals
  1. POKohana Captcha module
    text
    copied!<p>I'm trying to use <a href="https://github.com/kolanos/kohana-captcha" rel="nofollow">kohana-captcha module</a> for a Kohana 3.3 project. Everything works fine until the validation.</p> <p>The problem is that Captcha module always shows different answer no matter what image has been generated. Here is the example of my code:</p> <pre><code>&lt;?php defined('SYSPATH') or die('No direct script access.'); class Controller_User extends Controller_Template { public $template = "template"; public function action_create() { if (isset($_POST['captcha'])) { print $_POST['captcha']; print "&gt;&gt;&gt;".Captcha::valid($_POST['captcha'])."&lt;&lt;&lt;"; } $captcha = Captcha::instance(); $this-&gt;template-&gt;content = View::factory('user/create') -&gt;bind('captcha', $captcha); } } ?&gt; </code></pre> <p>View code:</p> <pre><code>&lt;form method="post" action="/user/create/" class="form-horizontal" id="form"&gt; &lt;div class="control-group"&gt; &lt;label class="control-label" for="inputCaptcha"&gt; &lt;?=$captcha?&gt; &lt;/label&gt; &lt;div class="controls"&gt; &lt;input type="text" id="inputCaptcha" placeholder="Код с картинки" name="captcha"&gt; &lt;span class="help-inline"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p><code>$_SESSION and $_COOKIE</code> arrays are also empty. The point is that I see the captcha image, enter the code, submit a form and then receive nothing. <code>Captcha::valid($_POST['captcha'])</code> shows me nothing. When I try to make <code>print_r($captcha)</code> after <code>Captcha::instance()</code> it shows me an object with a protected "response" property but it contains absolutely different letters and digits.</p> <p>For example, I see an image with a "KX5R" captcha code, here is the result of print_r($captcha):</p> <pre><code>Captcha_Alpha Object ( [driver:protected] =&gt; [response:protected] =&gt; MWXF [image:protected] =&gt; [image_type:protected] =&gt; png ) </code></pre> <p>Any advices?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload