Postingan lainnya
Error saat berhasil hosting codeigniter
https://imgur.com/RJAQLJJ
An uncaught Exception was encountered
Type: RuntimeException
Message: Unable to locate the model you have specified: Model
Filename: C:\xampp\htdocs\nilai_rapor\system\core\Loader.php
Line Number: 348
Backtrace:
File: C:\xampp\htdocs\nilai_rapor\index.php
Line: 315
Function: require_once
https://imgur.com/9TOrTCk
https://imgur.com/HtA3eVZ
controller
<?php
class Auth extends CI_Controller{
public function index()
{
$this->load->view('templates_administrator/header');
$this->load->view('administrator/login');
$this->load->view('templates_administrator/footer');
}
public function proses_login()
{
$this->from_validation->set_rules('username','username','required');
$this->from_validation->set_rules('password','password','required');
if ($this->from_validation->run() == FALSE) {
$this->load->view('templates_administrator/header');
$this->load->view('administrator/login');
$this->load->view('templates_administrator/footer');
}else {
$username = $this->input->post('username');
$password = $this->input->post('password');
$user = $username;
$pass = MD5($password);
$cek = $this->login_model->cek_login($user, $pass);
if ($cek->num_rows() > 0){
foreach ($cek->result() as $ck) {
$sess_data['username'] = $ck->username;
$sess_data['email'] = $ck->email;
$sess_data['level'] = $ck->level;
$this->session->set_userdata($sess_data);
}
if($sess_data['level'] == 'admin'){
redirect('administrator/dashboard');
}else {
$this->session->set_flashdata('pesan',' Username atau Password Anda Salah');
redirect('administrator/auth');
}
}else{
$this->session->set_flashdata('pesan',' Username atau Password Anda Salah');
redirect('administrator/auth');
}
}
}
}
0
1 Jawaban:
<div>Sepertinya ada typo pada login_model.php line 17. pada bagian ini:</div><pre>array('username' => $u, 'password', => $p)</pre><div>Seharusnya menjadi: (hilangkan koma)</div><pre>array('username' => $u, 'password' => $p)</pre><div><br>Semoga membantu</div>
0