I'm using md5 to encrypt the user's password in my database, and I want them to get their password back when they forget by sending them email. The problem is I don't know how to write PHP code to recover it back.
Any answer, or appropriate link would be very much appreciated. Thanks..
This cannot be done1
MD5 is a hashing function and not an encryption function. It is a one-way process and not reversible.
1Actually, there are many such passwords (inputs) which will result in the same MD5 value when hashed, but it's "hard" to find just one and [generally] impossible to find the original one. This is what "cracking" a password does - it finds one such input that, when hashed, results in the particular output. (And I will provide no more help down this road.)