how to do a login divided into two parts?

-2

What I want to do is type a bank login system with two access passwords, the first part I have already done, so I wanted to log in to parte 2 where it asks for senha 2 and nome do usuario .

If he hits the parte 1 chore he goes to part two with his data, but if he has not logged the parte 1 of the error.

    
asked by anonymous 28.12.2015 / 13:14

2 answers

0

I'm pretty rusty with PHP, so try to exemplify with a generic code here ...

I think the most interesting way would be to work with session

    if(classeDeLogin.validaUsuarioParte1('usuario','senha')
    {
         $_SESSION['login1'] = true;
         //Redireciona para a pagina de login 2
    }

On this page you could do the following

    //Verifica se o login parte 1 foi realizado
    if($_SESSION['login1'] == true)
    {
    if(classeDeLogin.validaUsuarioParte2('usuario','senha')
       {
          //Aqui não lembro exatamente o comando, mas a idéia é atribuir null a variável de sessão login1
          $_SESSION['login1'] = null;
          $_SESSION['userLogged'] = true;
          //Redireciona para sua pagina principal

       }
    }
    else
    {
        //Redireciona para pagina de login parte 1
    }
    
28.12.2015 / 13:42
-1

Good morning,

After you validate the 1 login, you play its login name in a session and redirect to the login2 screen.

In login screen 2, in the login field you will see the name that is in the session and asks you to enter the password. When entering the password you would do the same normal validation in step 1. If the verification in step 2 works, you redirect the user to index, otherwise you can send him back to the login page 1 or to the login page 2 even.

    
28.12.2015 / 13:45