Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <form name='userlogin' action='<?php echo base_url();?>/index.php/myform/checkLogin' method='post'>
  2. <input type="text" name='username' id='username' class="form-control" placeholder="Username" style='height: 3em;'><br>
  3. <input type="password" name='password' id='password' class="form-control" style='height: 3em;' placeholder="Password" required><br>
  4. <center><button class="btn draw-border" type="submit" >Sign in</button></center>
  5. <center><br><a href= "/ci/index.php/myform/<?php echo "userRegistration";?>">Register</a></center>
  6. </form>
  7.  
  8. public function showLogin(){
  9.  
  10. $this->load->view('loginview');
  11.  
  12. }
  13.  
  14. public function checkLogin() {
  15.  
  16. $user = $this->input->post('username');
  17. $pass = $this->input->post('password');
  18.  
  19. $this->db->where('username', $user);
  20. $this->db->where('user_password', $pass);
  21.  
  22. $this->successmessage();
  23. }
  24.  
  25. NOTE: I'm not yet where I want to be to incorporate the sessions library. That's next. Now I need to wrap my head around the operation performed to match user login creds with DB table.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement