Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Proses extends CI_Controller {
- /**
- * Index Page for this controller.
- *
- * Maps to the following URL
- * http://example.com/index.php/welcome
- * - or -
- * http://example.com/index.php/welcome/index
- * - or -
- * Since this controller is set as the default controller in
- * config/routes.php, it's displayed at http://example.com/
- *
- * So any other public methods not prefixed with an underscore will
- * map to /index.php/welcome/<method_name>
- * @see https://codeigniter.com/user_guide/general/urls.html
- */
- public function proses_login(){
- $username= $this->input->post('username');
- $password= $this->input->post('password');
- $data=array(
- 'username'=>$username,
- 'password'=>$password);
- print_r($data);
- $cek = $this->M_db->cek_login($data)->result_object();
- if ($cek){
- foreach ($cek as $v) {
- $username=$v->username;
- $nama=$v->nama;
- }
- $data_session= array(
- 'username'=>$username,
- 'nama'=>$nama,
- );
- $this->session->set_userdata($data_session);
- redirect('admin/dashboard');
- }
- $this->session->set_flashdata('info','username atau password salah');
- redirect('welcome');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement