Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Login extends Controller
- {
- private $_username;
- private $_password;
- function __construct()
- {
- parent::Controller();
- $this->_username = $this->input->post('username');
- $this->_password = $this->input->post('password');
- }
- function index()
- {
- if(!$this->_username || !$this->_password)
- {
- $sessionData = array('loginError' => true, 'type' => 1);
- $this->session->set_flashdata($sessionData);
- redirect('/');
- }
- else
- {
- $this->_procLogin();
- }
- }
- function _procLogin()
- {
- $this->load->model('loginmodel');
- if($this->loginmodel->checkLogin($this->_username, $this->_password))
- {
- echo 'login success';
- }
- else
- {
- echo 'login failed';
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement