I have database entry for password in md5 format, but when user uses the \"Forgot password\" then how can i give him/her the desired password?
You can't do it without putting the password in the database, which is undesirable, but you can generate him/her a new password and send it to them. Or a link where they can reset their password.