Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Codeigniter missing argument 1
- <?php
- class C_login extends CI_Controller{
- public function __construct() {
- parent::__construct();
- $this->load->model('m_login');
- }
- function index()
- {
- $this->form_validation->set_rules('username','trim|Username','required|exact_length[4]|xss_clean');
- $this->form_validation->set_rules('password','trim|Password','required|min_length[4]|max_length[40]|xss_clean|callback_login');
- if($this->form_validation->run() == false)
- {
- $this->load->view('login');
- }
- else
- {
- echo 'sukses validasi';
- }
- }
- function login($password)
- {
- $username = $this->input->post('username');
- $password = $this->input->post('password');
- $jabatan = $this->input->post('jabatan');
- $value = $this->m_login->cekpass($username,$password,$jabatan);
- if($value)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
- ?>
- <?php
- class M_login extends CI_Model{
- public function __construct() {
- parent::__construct();
- }
- function login ($username, $password, $jabatan)
- {
- $this->db->where('username',$username);
- $this->db->where('password',$password);
- $this->db->where('jabatan',$jabatan);
- $value = $this->db->get('ms_user');
- if($value->num_rows()>0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }?>
Add Comment
Please, Sign In to add comment