hgg Posted January 15, 2009 Share Posted January 15, 2009 Hope this isn't an old problem that I've missed the response to- My passwords that are generated for student login use to work fine-now theyare generated, stored in the database but the new passwords won't work. Hosting company says they've made no changes, though there was a recent server upgrade. Link to comment https://forums.phpfreaks.com/topic/141000-phpmysql-password/ Share on other sites More sharing options...
trq Posted January 15, 2009 Share Posted January 15, 2009 Are you using mysql's PASSWORD function to encrypt these passowrds? Link to comment https://forums.phpfreaks.com/topic/141000-phpmysql-password/#findComment-737965 Share on other sites More sharing options...
hgg Posted January 16, 2009 Author Share Posted January 16, 2009 Thought I'm totally new to php I believe the code was written that way: function pw_encrypt ($pwd) { global $pass; $pass = crypt ($pwd); } Link to comment https://forums.phpfreaks.com/topic/141000-phpmysql-password/#findComment-738065 Share on other sites More sharing options...
corbin Posted January 16, 2009 Share Posted January 16, 2009 I'm on my laptop, so I don't have access to PHP to check, but I'm fairly sure crypt generates a new salt each time it's called if you do not supply one. In other words, the chances of the passwords ever matching again is slim. You need to provide the same salt everytime. http://php.net/crypt Link to comment https://forums.phpfreaks.com/topic/141000-phpmysql-password/#findComment-738074 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.