What I'm actually trying to do is to hash a password using 'sha1', which I have already done. However, every value I submit as the password, the encryption result is the same for anything I type in, which is in this case is the following:
Code: Select all
da39a3ee5e6b4b0d3255bfef95601890afd80709I have been trying to fix this issue for the past hours. Yet, I still couldn't find an answer. Please, take a quick look at my coding below:
Code: Select all
<?php
$user_first_name = $_POST['user_first_name'];
$user_last_name = $_POST['user_last_name'];
$user_email = $_POST['user_email'];
$user_password = $_POST['user_password'];
$user_hashed_password = sha1($user_password);
?>
<?php
$query = "INSERT INTO users (
user_first_name, user_last_name, user_email, user_hashed_password
) VALUES (
'{$user_first_name}', '{$user_last_name}', '{$user_email}', '{$user_hashed_password}'
)";
if (mysql_query($query, $connection)) {
// Success
$message = "The user was succesfully created!";
header ("Location: index.php");
exit;
} else {
// Error
$message = "The user could not be created!";
echo "<br />" . mysql_error();
}
?>
Luis