What happens is that I need to encrypt the passwords that are entered on the website, but it turns out that when the passwords are entered and saved in the database, the passwords arrive unencrypted, this is the code of the signup.php page
<?php
require 'database.php';
$message = '';
if (!empty($_POST['usuario']) && !empty($_POST['password'])) {
$sql = "INSERT INTO usuarios (usuario, email, password) VALUES (:usuario, :email, :password)";
$stmt = $conn -> prepare($sql);
$stmt -> bindParam(':usuario',$_POST['usuario']);
$stmt -> bindParam(':email',$_POST['email']);
$password = password_hash($_POST['password'], PASSWORD_BCRYPT);
$stmt -> bindParam(':password',$_POST['password']);
if ($stmt -> execute()) {
$message = 'Se ha creado su cuenta satisfactoriamente en HardSoft';
}
else {
$message = 'Lo sentimos, pero ha ocurrido un problema con la base de datos';
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registrarse</title>
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<?php require 'partials/header.php' ?>
<?php if (!empty($message)):
?>
<p><?= $message ?></p>
<?php
endif;
?>
<h1>Registrarse</h1>
<span>ó <a href="login.php">Iniciar Sesión</a></span>
<form action="signup.php" method="POST">
<input type="text" name="usuario" placeholder="Usuario">
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Contraseña">
<input type="password" name="confirm_password" placeholder="Confirme la contraseña">
<input type="submit" value="Enviar">
</form>
</body>
</html>