Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $user = "root";
- $pass = "base7";
- $banco = "cadastro";
- $conexao = mysql_connect($host,$user,$pass) or die(mysql_error());
- mysql_select_db($banco) or die(mysql_error());
- ?>
- <html>
- <head>
- <title>autenticando.....<title/>
- <script type="text/javascript">
- function loginsucessfuly() {
- setTimeout("window.location='base7.html'",5000);
- }
- function loginfailed() {
- setTimeout("window.location='index.html'",5000);
- }
- </script>
- <head/>
- <body>
- <?php
- $nome=$_POST['nome'];
- $senha=$_POST['senha'];
- $sql = mysql_query("SELECT * FROM usuarios WHERE nome = '$nome' and senha = '$senha'" or die(mysql_error());
- $row = mysql_num_rows($sql);
- if($row > 0) {
- session_start();
- $_SESSION['nome']=$_POST['nome'];
- $_SESSION['senha']=$_POST['senha'];
- echo"<center>Parabens vc acertou a senha haha,aguarde sรณ um instante estamos te redirecionando!</center>";
- echo"<script>loginsucessfully()</script>";
- } else {
- echo"<center>nome do usuario invalido</center>";
- echo"<script>loginfailed()</script>";
- }
- ?>
- <body/>
- <html/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement