Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function canilogin( $username, $password){
- $conn = new mysqli("localhost", "root", "root", "netflix");
- // $salt = "eggsrdfgfgfgfgfghbgfdgsdoinfdsnofnqsiof";
- // $password = md5($password.$salt);
- $query = "select * FROM users WHERE email='".$conn->real_escape_string($username). "'";
- $result = $conn->query($query);
- if($result->num_rows != 1){
- return false;
- }
- $user = $result->fetch_assoc();
- if(password_verify($password, $user['password'])){
- return true;
- }
- else{
- return false;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement