Advertisement
Guest User

Untitled

a guest
Aug 21st, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. if(!empty($_POST['username']) && !empty($_POST['password'])){
  2.  
  3. $username = $_POST['username'];
  4.  
  5. $password = $_POST['password'];
  6.  
  7. $result = user_login($username,$password);
  8.  
  9. if($result){
  10. @header("Location: index.php");
  11. }
  12. }
  13. }?>
  14.  
  15. enter code here
  16.  
  17. global $connection;`enter code here`
  18. if(!empty($username) && !empty($password)){
  19. $query = "select * from login where username = '$username' and password = '$password'";
  20. $result = mysqli_query($connection, $query);
  21. $count = mysqli_num_rows($result);
  22. if($count > 0 ){
  23. return true;
  24. }else{
  25. echo "We didn't recognise your username or password. Please try again.";
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement