Mysql (MariaDB) with PDO

From cod3v


Some of my database stuff is shown.

Establishing connection to the server

Store the password into a secure place, thus above the the www directory. Php can access that.

Log a user

SSL connection. Hash and salt. Php password hashing functions and mainly password_hash with password_verify.

Check the database if the username is exists. If it is, fetch the password hash and compare that against the user inputted hash.