(05-05-2018, 02:24 AM)jreklund Wrote: You need to read the tutorial again, now you got two RUN() functions.
Start fresh and just copy that code before you try to introduce your code.
same, I introduced a single function, but it still does not block when the fields are empty
Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login_controller extends CI_Controller {
public function index()
{
echo 'welcome to login';
}
function login_pro()
{
/*echo $user = $this->input->post('user');
echo $pass = $this->input->post('pass');*/
$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';
}
}
}