Print Alert PHP [duplicate]

-1

Good personal how I can print the contents of something of the php in a div for example: I have a login area, if the user data is wrong I want you to print a div with alert (with bootstrap) on the same page. I have this validation in php but I want it to show me in a div

follow codes

login

         <form class="login-form" method="POST" action="pg/logar.php">
  <input required type="text" name="f_usuario" placeholder="Usuario"/>
  <input required type="password" name="f_senha" placeholder="Senha"/>
  <button type="submit">Logar</button>

logar.php

     if($linhas > 0){
    $_SESSION['usuario'] = $usuario;
    $_SESSION['senha'] = $senha;
    header("Location:../logado.php");
   }else{
    echo "Dados Digitados Incorretos";
   }
    
asked by anonymous 03.07.2016 / 00:39

1 answer

1

Try this:

echo '<div id="alert">Dados Digitados Incorretos</div>';
    
03.07.2016 / 00:53