PHP - MSSQL, Update MD5 Hashed Password.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cbunting99
Forum Newbie
Posts: 1
Joined: Sun Feb 15, 2015 10:06 pm

PHP - MSSQL, Update MD5 Hashed Password.

Post by cbunting99 »

I have a basic webpage that allows the user to submit a username, email and password for their accounts. These are done on our website with php but we send to another site of ours using MSSQL. The MD5 and salt use this,

Code: Select all

	$Salt = $username.$pwd;
	$Salt = md5($Salt);
	$Salt = "0x".$Salt;
I need a simple solution to allow the username and email for the account to match, then to include the passwd and repasswd fields so that the user can update their passwords. We haven't had a way for users to do this but I am a bit lost where MSSQL is concerned.

Would anyone have a basic example or an idea of how to do this? I figured I'd try here before using one of the freelancer sites as I just need something that works.

Thanks,
Chris
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP - MSSQL, Update MD5 Hashed Password.

Post by requinix »

"MS SQL" is just a database. It works just like other databases like MySQL or PostgreSQL (with some syntax and behavior differences, of course). What matters is your PHP code.

So, an idea how to change passwords? Recalculate $Salt using the new password, then update the database with the new value. That should be all you need to do.
Post Reply