Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

md5() question ??

Status
Not open for further replies.

hisham

IS-IT--Management
Nov 6, 2000
194
As PHP contains no functions for decrypting a hashed string, and I use md5() to encrypt users passwords in a database. Who can I create a login code that can select the password?
If I use:
$query = mysql_query("SELECT * FROM users where password = “$password”);
This will returns the encrypt password, so when the user enter his password, he will gets an Invalid one.
 
$scrammbled_password = md5($password);

$query = mysql_query("SELECT * FROM users where password = '$scrammbled_password');

unset($scrammbled_password);

That's all :)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top