Advertisement
Guest User

Untitled

a guest
Feb 16th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <?php
  2. $host = "localhost";
  3. $user = "root";
  4. $pass = "base7";
  5. $banco = "cadastro";
  6. $conexao = mysql_connect($host,$user,$pass) or die(mysql_error());
  7. mysql_select_db($banco) or die(mysql_error());
  8. ?>
  9.  
  10. <html>
  11. <head>
  12. <title>autenticando.....<title/>
  13.  
  14. <script type="text/javascript">
  15.  
  16. function loginsucessfuly() {
  17. setTimeout("window.location='base7.html'",5000);
  18. }
  19.  
  20. function loginfailed() {
  21. setTimeout("window.location='index.html'",5000);
  22. }
  23. </script>
  24.  
  25. <head/>
  26.  
  27.  
  28. <body>
  29.  
  30.  
  31. <?php
  32. $nome=$_POST['nome'];
  33. $senha=$_POST['senha'];
  34. $sql = mysql_query("SELECT * FROM usuarios WHERE nome = '$nome' and senha = '$senha'" or die(mysql_error());
  35. $row = mysql_num_rows($sql);
  36. if($row > 0) {
  37. session_start();
  38. $_SESSION['nome']=$_POST['nome'];
  39. $_SESSION['senha']=$_POST['senha'];
  40. echo"<center>Parabens vc acertou a senha haha,aguarde sรณ um instante estamos te redirecionando!</center>";
  41. echo"<script>loginsucessfully()</script>";
  42.  
  43. } else {
  44. echo"<center>nome do usuario invalido</center>";
  45. echo"<script>loginfailed()</script>";
  46. }
  47. ?>
  48.  
  49. <body/>
  50. <html/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement