Created
July 18, 2019 09:24
-
-
Save wsupajirakit/e9957b3f9b44c860e4e61730f6f44394 to your computer and use it in GitHub Desktop.
controllers/Welcome.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Welcome extends CI_Controller { | |
public function index() | |
{ | |
// $data['id'] = $this->uri->segment(3); | |
// $this->load->view('user_manage/custom_edit',$data); | |
// $this->load->model('Simple_model'); | |
// //assign paremeter | |
// $data['req'] = $this->Simple_model->get_req(); | |
// $data['id'] = $this->uri->segment(3); | |
$this->load->view('index'); | |
} | |
public function home() | |
{ | |
$this->load->view('welcome_message'); | |
} | |
function check_login(){ | |
$this->load->model('simple_model'); | |
$res = $this->simple_model->check_login(); | |
if($res == "1"){ | |
$this->load->library('session'); | |
$this->session->set_flashdata("login_status","true"); | |
redirect("welcome/home"); | |
} else { | |
$this->session->set_flashdata('login_status', "fail"); | |
redirect("welcome"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment