Bek
|
| Posted: 05/01/2002, 7:58 PM |
|
I have a MySQL database filled with usernames, login id, and passwords. The passwords have been encrypted in MD5 format.
How do I tell CC to encrypt the password on a log in page so that it matches what is in the database?
I am creating PHP pages talking to a MySQL DB.
Any help would be greatly appreciated. Thanxs.
|
|
|
 |
Bek
|
| Posted: 05/01/2002, 9:03 PM |
|
I'm sorry, I should have posted this earlier. Here is what my select statment looks like now.
$db->query("SELECT securityid,level_id FROM security WHERE loginname =" .
tosql($sLogin, "Text") . " AND password= " . tosql($sPassword, "Text"));
Thanks Again.
|
|
|
 |
jjtoubia
|
| Posted: 05/01/2002, 10:07 PM |
|
Try this...
$db->query("SELECT securityid,level_id FROM security WHERE loginname =" .
tosql($sLogin, "Text") . " AND password= " . tosql(md5($sPassword), "Text"));
Let me know if this works...off the top of my head I believe it should.
|
|
|
 |
Mark
|
| Posted: 05/02/2002, 3:58 PM |
|
Hi,
if you store a password encrypted in the database, how can you send a user a password reminder if they forget it ?...
Thanks,
Mark
|
|
|
 |
Bek
|
| Posted: 05/02/2002, 4:13 PM |
|
That for the suggestion but I can't seem to get it to work.
I've tried;
$db->query("SELECT securityid,level_id FROM security WHERE loginname =" .
tosql($sLogin, "Text") . " AND password= " . tosql(md5($sPassword), "Text"));
and
$db->query("SELECT securityid,level_id FROM security WHERE loginname =" .
tosql($sLogin, "Text") . " AND password= " . tosql(md5($sPassword), "Text")));
but neither work. I've forgotten the error message, I will post it when I get back to my office and can resproduce it. Any other suggestion
In response to Mark:
THat's a great question. To my knowledge, if you encrypt the password in your database you can't send it to the user. I think you need to create an application that will generate a password in the case someone forgets one. Email the new password to the user and write it to the database again.
If someone knows of a better way, please post it. Thanks
Bek
|
|
|
 |
|