Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Which password field should I use for validation?

Featured Replies

I'm just doing this as part of a course to learn PHP, so it probably doesn't really matter anyway, but I'd like to have good habits from the start. I'm learning to create a CMS and I'm creating a page to edit user details. I have two password fields so the user has to re-type it, and they will be compared to see if they match.

 

I'm stuck on what to do with them. Should I compare the fields first, and if they match go on to password validation for one of them? Or should I pick a field (which though? Does it even matter?) and validate the password, then if there aren't any errors see if they match? At what point do I check that both fields are filled in? :/

  • Author

Check if the fields match and then validate it.

 

Yeah, this is what I ended up doing in the meantime. Though I just don't know whether the user would be annoyed at having to type matching passwords only to find out they aren't long enough, or have other problems. Might be overthinking it though - I mean, it's not that difficult to type in another twice, is it?

 

Rallport -

Thanks. I wasn't sure about checking for numbers/symbols included, as I heard that doesn't really make passwords strong? I thought it was advised now that passwords should be more like random phrases?

 

Validate when the password was last changed

Would you mind explaining about this? Does it matter if the password has been recently changed?

 

Oh, and yes, I've learned about encryption :) It took a while to get my head around it. I haven't tried using the built in PHP functions yet.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.