title: How to hash a password in php, save it to the mysqli DB and then compare it to an input later
body: <p>I just want some simple code on how to hash a password(i read about the function crypt()???) because apparently md5 and sha isn't good enough... and then also how to add salts? my main worry is how i will compare them afterwards with the salt implemented... i know how to write and read from the database. I just need a code snippet on the actual hashing process and the comparing process. I understand all the concepts on salts and hashing, I am just not too sure of the code. Thanks a lot everyone.</p>
  
  <p>Oh also if you could it would help if you could also show how to prevent timing attacks.</p>