Advertisement
Guest User

Untitled

a guest
Mar 6th, 2018
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2. function canilogin( $username, $password){
  3.  
  4. $conn = new mysqli("localhost", "root", "root", "netflix");
  5. // $salt = "eggsrdfgfgfgfgfghbgfdgsdoinfdsnofnqsiof";
  6. // $password = md5($password.$salt);
  7.  
  8. $query = "select * FROM users WHERE email='".$conn->real_escape_string($username). "'";
  9. $result = $conn->query($query);
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. if($result->num_rows != 1){
  17. return false;
  18. }
  19. $user = $result->fetch_assoc();
  20. if(password_verify($password, $user['password'])){
  21. return true;
  22. }
  23. else{
  24. return false;
  25. }
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement