Re: comparing a string to a password encrypted file in MySQL
| From: | Joaco | Date: | Thu, 22 May 2003 19:53:53 +0000 |
| Subject: | Re: comparing a string to a password encrypted file in MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148629@lists.php.net to get a copy of this message | ||
You cant compare the plain text per se...
what you need to do is encrypt the plain text using the same algorithm and then compare the
encrypted password to the encrypted plain text. If you have a match, it is correct.
"Don" <donpro@lclcan.com> wrote in message news:010401c3209b$5c49dc70$c889cdcd@enterprise...
Hi,
I have a table holding usernames/passwords where the passwords have been
one-way encrypted using the password() function.
The user is entering his/her password in plain text. How do I compare it
with the encrypted password field in my MySQL table?
Caveat: I first want to retrieve the row based ONLY on the username. Then,
I want to check if the password is correct. I can't seem to find a PHP
equivalent of the MySQL password() function.
Thanks,
Don
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 5/19/2003