title: PHP Reset Password with code instead of link
body: <p>Is there anything wrong with emailing a user a randomly generated code rather than a link when they want to change their password.</p>
  
  <p>The procedure would be...</p>
  
  <ol>
  <li>User triggers password reset by entering email address</li>
  <li>Email is checked in DB to be a genuine user</li>
  <li>Email is sent to that user with a randomly generated code</li>
  <li>The same code is bcrypt'ed and inserted in the database in a dedicated column</li>
  <li>User enters the code sent to them by email</li>
  <li>It is checked against the stored based bcrypt password</li>
  <li>(If all correct) User is allowed to enter a new password</li>
  </ol>