As defined in the database the confirm password field

Asked

Viewed 332 times

0

When registering in the system the user will have to confirm the password to register, however I have no knowledge of how to proceed and if this is done with some function in PHP or some validation of the type.My question is also whether I need to create in my table register the field confirm password.

I am using PHP and MYSQL to develop this registration system.

  • In case I create a login table and another containing the user ? And the function to verify the password do with php ?

  • You want to know how to have the registration field confirm password, so the user does not enter the wrong password unintentionally?

  • Exact Guilherme

1 answer

7


No need to do anything nobanco this is just a comparison in php:

if ($_POST["senha"] == $_POST["confirmar_senha"]) {
    //continua com o cadastro....
}

It’s nice to do this validation on the front end too, so the user won’t need to reload the page to know if he or she pressed an erado key, here has an exeplo of how to do with js

  • Thank you very much, thanks for the tip.

  • Why take the trouble to treat only on the server? This is not good for UX

  • I edited the reply commenting on this and with an example link

Browser other questions tagged

You are not signed in. Login or sign up in order to post.