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 C_tutorial extends CI_Controller {
- public function __construct(){
- parent::__construct();
- $this->load->helper('url','html');
- $this->load->library('form_validation');
- $this->load->model('M_query');
- }
- public function index()
- {
- $this->load->view('v_tutorial');
- }
- public function user_login()
- {
- $this->form_validation->set_rules('username', 'Username' , 'required');
- $this->form_validation->set_rules('password', 'Password' , 'required');
- $this->form_validation->set_error_delimiters('<span class="text-danger">','</span>');
- if ($this->form_validation->run() )
- {
- $username = $this->input->post('username');//sesuaikan nama fieldnya denagn inputan ok
- $password = $this->input->post('password');
- $this->M_query->login($username, $password);
- }
- else
- {
- $this->index();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement