(05-08-2018, 06:03 AM)rachidE Wrote: I've already done that, but without success
OK!
I've taken the code you have pasted in and created a brand new installation of CI 3.1.8
In order to get this thing working i had to do 2 changes to your code:
1, in the form i've changed base_url() to site_url()
2, see the example class
PHP Code:
<?php
class Test extends CI_Controller {
public function __construct() {
parent::__construct();
// Loading helpers and library
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
}
function login_pro() {
$this->form_validation->set_rules('Username', 'Username', 'required');
$this->form_validation->set_rules('Password', 'Password', 'required');
if ($this->form_validation->run() == FALSE) {
echo 'try again';
} else {
echo 'welcome';
}
}
}
Now, this is working fine on linux on PHP 7.2.5
Personally i do not like the case sensitive name tags in the form, so if it would be up to me u would rename Username to username, but that is just my preference..