Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class home extends CI_Controller{
- function __construct(){
- parent::__construct();
- $this->load->model('pengguna_model');
- }
- // function index(){
- // $this->load->view('home/login.php');
- // }
- function aksi_login(){
- $username = $this->input->post('pengguna');
- $password = $this->input->post('password');
- $where = array(
- 'pengguna' => $username,
- 'password' => md5($password)
- );
- $cek = $this->pengguna_model->cek_login("pengguna",$where)->num_rows();
- if($cek > 0){
- $data_session = array(
- 'pengguna' => $username,
- 'password' => md5($password)
- );
- $this->session->set_userdata($data_session);
- redirect('dashboard');
- }else{
- echo "Username dan password salah !";
- }
- }
- function logout(){
- $this->session->sess_destroy();
- rredirect('depan/login');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement