Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function index()
- {
- // Load User Model, Auto connect to DB
- $this->load->model('User_model','', TRUE);
- $data = array();
- $loggedIn = false;
- $attemptedLogIn = isset($_POST['username'], $_POST['password']);
- if($attemptedLogIn)
- {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $loggedIn = $this->User_model->login($username, $password);
- }
- if ($loggedIn)
- {
- // Redirect
- }
- else
- {
- $data['title']
- if ($attemptedLogIn) {
- $data['heading'] = 'Log in attempt failed';
- } else {
- $data['heading'] = 'Please log in';
- }
- $this->load->view('login', $data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement