What are the potential security risks of using plain text and not implementing a password verification system in a PHP login system?

Storing passwords in plain text leaves them vulnerable to being easily accessed by malicious actors if the database is compromised. Implementing a password verification system, such as hashing passwords before storing them, adds an extra layer of security by making it difficult for attackers to retrieve the original passwords.

<?php

// Hashing the password before storing it in the database
$password = $_POST['password'];
$hashed_password = password_hash($password, PASSWORD_DEFAULT);

// Storing the hashed password in the database
// Your database query here

?>