pixeltrace Posted May 22, 2007 Share Posted May 22, 2007 guys, i need help, one of my sites that i maintain has an edit profile and on that page, there is a field for the password password textfield verifypass textfield currently the password is in md5 how do i set this up in such a way that if the user edits his profile the current password is already there. need help on this please. thanks! Link to comment https://forums.phpfreaks.com/topic/52430-help-on-edit-password/ Share on other sites More sharing options...
pocobueno1388 Posted May 22, 2007 Share Posted May 22, 2007 Well, an md5 encryption is only one way...you can't reverse it [very easily at least]. I am thinking the only way you can do that is have a field in the DB that holds the normal text version of their password. Link to comment https://forums.phpfreaks.com/topic/52430-help-on-edit-password/#findComment-258739 Share on other sites More sharing options...
pixeltrace Posted May 22, 2007 Author Share Posted May 22, 2007 i see, yeh, that is one solution. thanks! Link to comment https://forums.phpfreaks.com/topic/52430-help-on-edit-password/#findComment-258742 Share on other sites More sharing options...
OOP Posted May 22, 2007 Share Posted May 22, 2007 Hi there, when you display the user's profile, just leave the password field empty. You just update the field with any supplied new password if any. Link to comment https://forums.phpfreaks.com/topic/52430-help-on-edit-password/#findComment-258747 Share on other sites More sharing options...
jitesh Posted May 22, 2007 Share Posted May 22, 2007 Query may be like this $sql = "Update profile set name = '".$_POST['name'].", email = '".$_POSE['email']." if(isset($_POST['password']) and !empty($_POST['password'])){ $sql .= ", password = '".md5($_POST['password'])."'"; } $sql .= " Where ............... "; Link to comment https://forums.phpfreaks.com/topic/52430-help-on-edit-password/#findComment-258752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.