Devexz Posted February 20, 2012 at 07:31 PM Report Share #440477 Posted February 20, 2012 at 07:31 PM Eu tenho um form e quando faço login uso o header(location:"balbla"); mas quando a pass ta errada o erro é mostrado noutra pagina sem o form. Eu queria era por a mensagem de erro por baixo do form... Alguma sugestao? Cumps. Contador de calorias: caloriaspordia.com Link to comment Share on other sites More sharing options...
yoda Posted February 20, 2012 at 08:13 PM Report Share #440482 Posted February 20, 2012 at 08:13 PM Faz tudo na mesma página. Ex : login.php <?php # erros $errors = array(); if ($_POST) { # alguém tentou fazer login, processar os dados # se o login falhar : $errors[] = 'falhou o login!'; # isto permite enviar para o ecrã os erros que quiseres } ?> <html> .. .. <form action="login.php" method="post"> </form> <?php if (!empty($errors)) : foreach ($errors as $error) : ?> <div class="error"><?php echo $error; ?></div> <?php endforeach; endif ?> .. .. </html> before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now