Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $user = "root";
- $pass = "";
- $banco = "Cadastro";
- $conexao = mysql_connect($host, $user, $pass) or die(mysql_error());
- mysql_select_db($banco) or die(mysql_error());
- ?>
- <html>
- <head>
- <title>
- </title>
- <script type="text/javascript">
- function Loginsuccessfully(){
- setTimeout ("window.location='painel.php'", 5000);
- }
- function Loginfailed() {
- setTimeout("window.location='Login.php'", 5000);
- }
- </script>
- </head>
- <body>
- <?php
- $email=$_POST['email'];
- $senha=$_POST['senha'];
- $sql= mysql_query("SELECT * FROM usuarios WHERE email = '$email' and senha = '$senha'") or die (mysql_error());
- $row = mysql_num_rows($sql);
- if ($row > 0) {
- session_start();
- $_SESSION['email']=$_POST['email'];
- $_SESSION['senha']=$_POST['senha'];
- echo "Voรงe foi autenticado com sucesso! aguarde um instante.";
- echo "<script>Loginsuccessfully()</script>";
- } else {
- echo "<center>Nome de usuario Invalido! aguarde um instante para voltar a tentar</center>";
- echo "<script>Loginfailed()</script>";
- }
- ?>
- </html>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement