Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeigniter form_validation always return false
    primarykey
    data
    text
    <p>i try to validate my form, but it always return with FALSE. The form fill the POST variable, the validation config is setted up, but it don't work. I tried everything, and now i stucked. Maybe your eyes catch the error.</p> <p>Here is my controller:</p> <pre><code> public function new_pass() { $code = mysql_real_escape_string($this-&gt;uri-&gt;segment(3)); $this-&gt;load-&gt;model('forgot_password_model'); if($this-&gt;forgot_password_model-&gt;check_code($code)) { if($this-&gt;input-&gt;post('submit')) { $this-&gt;new_pass_validation(); } else { $this-&gt;new_pass_form(); } } else { redirect('welcome'); } } private function new_pass_validation() { $this-&gt;load-&gt;library('form_validation'); var_dump($this-&gt;form_validation-&gt;run('forgot_password/new_pass')); var_dump($this-&gt;input-&gt;post()); if ($this-&gt;form_validation-&gt;run() === FALSE) { // print_r('dump' . validation_errors()); $this-&gt;new_pass_form(); } else { } } </code></pre> <p>The config/form_validation:</p> <pre><code>$config = array( 'forgot_password/new_pass' =&gt; array( array( array( 'field' =&gt; 'password', 'label' =&gt; lang('default_jelszo'), 'rules' =&gt; 'trim|required|min_length[5]|max_length[32]' ), array( 'field' =&gt; 'repassword', 'label' =&gt; lang('default_jelszo_megerosites'), 'rules' =&gt; 'trim|required|matches[password]|callback_password_hash' ), ) ), ); </code></pre> <p>And the view:</p> <pre><code>&lt;section id="content"&gt; &lt;a id="logo" href=""&gt;&lt;/a&gt; &lt;?=validation_errors(); ?&gt; &lt;div class="formwrapp"&gt; &lt;form action="&lt;?=site_url() . $this-&gt;uri-&gt;uri_string(); ?&gt;" method="post"&gt; &lt;h3&gt;Forgot password&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;Pass&lt;/li&gt; &lt;li&gt;&lt;input type="password" value="" name="password" /&gt;&lt;/li&gt; &lt;li&gt;Repass&lt;/li&gt; &lt;li&gt;&lt;input type="password" value="" name="repassword" /&gt;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;input id="login" type="submit" value="Submit" name="submit" /&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/form&gt; &lt;/div&gt; &lt;/section&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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