Skip to content

Instantly share code, notes, and snippets.

@jblac
Created December 31, 2012 18:19
Show Gist options
  • Save jblac/4421802 to your computer and use it in GitHub Desktop.
Save jblac/4421802 to your computer and use it in GitHub Desktop.
<?php
class user extends CI_Controller {
public function __construct() {
parent::__construct();
}
function login() {
$data = '';
if ($this->input->post('username')) {
$this->load->model('bm_users');
$user = $this->bm_users->login($this->input->post());
if ($user !== 'failed') {
$data['resp'] = '1';
} else {
$data['resp'] = '0';
$data['err'] = 'The username/password combination did not match. Please try again.';
}
$dta = json_encode($data);
echo $dta;
} else {
$this->load->view('login');
}
}
function login_check() {
vardump($_POST);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment