Page 1 of 1

Form / Password / Saving / Overwriting Procedure Question

Posted: Mon Nov 30, 2015 1:15 pm
by diseman
Not a code question, but a procedure one instead. If it turns out I need more help, I'll post my code.

So, I have this form with my contact information, email address, and password field.

I fill it in and save it to db along with hashed password.

I bring up the form again and look at all my data saved. Looks good! I then decide I want to change my phone number and submit form again.

Now the password has changed in the db 'cause the hashed password that was showing in the password input box was rehashed and sent to the db as a new password when I submitted the form.

What's the standard for dealing with this issue?

Also, while I'm at it. The password input box was showing the hashed password (i.e. ************************) from beginning to end of the password field. Looks dumb. How would I make it so only 7 stars show? 7 is just a random number I picked? Can't find anything on Google relating to this, which is silly 'cause sites to it all the time. I might have a 12 character password, but they only show 6 stars in the field.

Thanks!

Re: Form / Password / Saving / Overwriting Procedure Questio

Posted: Mon Nov 30, 2015 1:58 pm
by Celauran
I typically do not populate password fields for the very reasons you've just described. I'll either have separate forms for changing passwords, or I'll have the fields present but only update the DB if they're filled in and pass validation.

Re: Form / Password / Saving / Overwriting Procedure Questio

Posted: Mon Nov 30, 2015 2:02 pm
by diseman
Hi Celauran,

Ok, so I thought of doing that too; where I don't populate the field, but it still sent an empty value on submit.

Re: Form / Password / Saving / Overwriting Procedure Questio

Posted: Mon Nov 30, 2015 2:07 pm
by Celauran
That's expected. If the field is empty, ignore it.

Re: Form / Password / Saving / Overwriting Procedure Questio

Posted: Mon Nov 30, 2015 3:00 pm
by diseman
Well of course that's how you do it! All seems so logical after you say it. :) Thank you again.