RES: [PHP-DB] Password field!
| From: | Paulo Henrique Lomanto | Date: | Wed, 25 Apr 2001 19:22:46 +0000 |
| Subject: | RES: [PHP-DB] Password field! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8890@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi.
You can do this:
Encrypt a passowrd before insert into db using $var =
md5('your_password'); and insert the $var into your pass field into
your db.
To verify the password, get the pass entered by user and do
$md5('user_pass') and do a select into your db like this:
SELECT user, ip FROM your_table WHERE user = '".$user_entered."' AND
pass = '".$md5('user_pass')."';
if this select return a row, the user pass is valid. If not, this is
not valid. And your password are encrypted! :)
[]´s
Lomanto, Paulo H.
- -----Mensagem original-----
De: Pedro M. S. Oliveira [mailto:oliveira.pedro@netcabo.pt]
Enviada em: quarta-feira, 25 de abril de 2001 16:01
Para: PHP db
Assunto: [PHP-DB] Password field!
Hello all!
i was wondering if any1 of you could help me with something.
i have a table with 3 fields user_ip, user and pass.
how can i encript the pass and then read compare it with a pass
inserted on the web page?
thanx
*******************************************
Pedro Miguel Silva Oliveira
Cell Phone: +351 96 5867227
SMS: 965867227@mail.tmn.pt
Email: Oliveira.Pedro@netcabo.pt
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBOuckBZyz9Qg5WP+kEQITSQCguN65L93RIeqmynzoV8uMArXinJEAoIPQ
WiDfcwq/ZJXTvDPPL6Xm3zwt
=jwsZ
-----END PGP SIGNATURE-----