Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wsupajirakit/e9957b3f9b44c860e4e61730f6f44394 to your computer and use it in GitHub Desktop.
Save wsupajirakit/e9957b3f9b44c860e4e61730f6f44394 to your computer and use it in GitHub Desktop.
controllers/Welcome.php
<?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