Learn
Featured
Courses
Home
Courses
PHP
jQuery
MEMBERS
Sign In My Account

CODING ACADEMY

Learn
Featured
Courses
Home
Courses
PHP
jQuery
MEMBERS
Sign In My Account
  • Filter
  • All
  • Apache
  • Augmented Reality
  • Bootstrap
  • canvas
  • Coding Challenges
  • Courses
  • CSS
  • Game Development
  • Google
  • Hosting
  • htaccess
  • HTML
  • javascript
  • jQuery
  • Mac
  • MySQL
  • PHP
  • Python
  • Swift
  • Windows
June 22, 2019
Patrick Morrow
PHP

How to use password_hash() in PHP

June 22, 2019
Patrick Morrow
PHP
phplogo.jpg

Probably one of the most common features required by website owners is the ability to log in. Implementing a simple login system is not all that challenging. However, the security involved can be quite complex.

We have all probably heard of some website storing passwords in pure text form within their databases. In other words, if a user has a password of qwerty12345 then this is stored in this form in the database. Now that is obviously not secure.

One of the easiest things a developer can do is to 'hash' the password. This basically means that the password in encrypted. To do this we can use the password_hash function within PHP as follows:

The output will be something like this:

The hashed password can then be stored in the database.

If you would like to learn more about PHP then enrol in the PHP for Beginners course.

 
June 22, 2019
Patrick Morrow
PHP

Tagged: password, password_hash, login

Patrick Morrow

How to use microtime() in PHP
How to Verify Passwords with password_verify() in PHP

Guest Blogger

Back To Top
Terms of Use
Privacy Policy
© 2024 Patrick Morrow ABN: 79 441 351 414
Cart (0)