Save Password using Password Hash in PHP | password_hash

preview_player
Показать описание
In this php video tutorial, You will be able to save your password with hash in your database.

Steps:
Create a sign up form
Submit the signup form with method post
Create the same function in controller
After that in that function, check for validation using form validation library in CodeIgniter
Set rules for name, email and password -
name - required
email -required and valid_email
password - required and min_length

Run the form validation
if true
then store password in database
else
load the signup page again

for storing password in hash

password_hash require two argument
password - string , get from the form
algorithm - algorithm name for hashing (PASSWORD_DEFAULT)

Returns the hashed password, or false on failure.

password_hash — Creates a password hash
password_hash() creates a new password hash using a strong one-way hashing algorithm. password_hash() is compatible with crypt(). Therefore, password hashes created by crypt() can be used with password_hash().

Check the document

Code link:

Login with hashed password:

#php #codeigniter #knowledgethrusters
Рекомендации по теме
Комментарии
Автор

Please make tutorial on dynamic quiz using php ajax mysql jquery, with countdowntimmer

rishabhraj
Автор

Thank you so much for sharing your knowledge :)

ckobajp
Автор

Please make a video for login using password hash

ShankarSharmashankarsharma