how to log in divided into two parts?

Asked

Viewed 291 times

-2

What I want to do is kind of a bank login system with two passwords, the first part I’ve done, so I wanted to take the login to parte 2 where he asks the senha 2 and the nome do usuario.

In case he accesses parte 1 it goes to part two with the respective data, but if he has not logged in the parte 1 of error.

  • Can you put in the code you already did? otherwise it’s hard to know what you’re missing...

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
    }

-1

Good morning ,

After validating 1 login ,you play its login name in a session and redirect to the login screen2.

On the login screen 2 , in the login field you display the name that is in the session and ask to enter the password. When you enter the password you would do an equal normal validation in step 1.If the verification in step 2 works, you redirect the usuairio to index , otherwise, you can send it back to login page 1 or login page 2 .

Browser other questions tagged

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