I dont know if this is the correct format for storing password to my database

// salt password with user username
$salt = $_POST[‘username’];
$password = sha1($password, $salt);

it works but i want to know if it is advisable to use it to store password.

NO NO NO NO NO

Use the password functions built into PHP instead of creating your own extremely insecure versions.

See http://php.net/manual/en/function.password-hash.php

4 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.