What are common pitfalls when using MD5 generated passwords in PHP login scripts?

Using MD5 generated passwords in PHP login scripts is not secure because MD5 is a weak hashing algorithm that can be easily cracked. To improve security, it is recommended to use stronger hashing algorithms like bcrypt or Argon2. This will make it much harder for attackers to decrypt passwords.

// Example of using bcrypt for hashing passwords in PHP
$password = "password123";
$hashed_password = password_hash($password, PASSWORD_BCRYPT);

// Verify password
if (password_verify($password, $hashed_password)) {
    echo "Password is correct!";
} else {
    echo "Password is incorrect!";
}