How to set the password field in the database

0

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

I'm using PHP and MYSQL to develop this system of registrations.

    
asked by anonymous 07.03.2018 / 02:12

1 answer

7

You do not have to do anything on the bank this is just a comparison in php:

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

It's cool to do this validation on the front end as well, so the user will not need to reload the page to see if he pressed a key, here has an exeplo of how to do with js

    
07.03.2018 / 02:23