Advertisement
Guest User

Untitled

a guest
Jun 7th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. <?php
  2. require_once 'init.php';
  3. ?>
  4. <html>
  5. <head>
  6. <meta charset="utf-8">
  7. <meta http-equiv="x-ua-compatible" content="ie=edge">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <title>Login</title>
  10. <link rel="stylesheet" href="/foundation-6/foundation.css">
  11. <link rel="stylesheet" href="/foundation-6/app.css">
  12. <link rel="stylesheet" href="/css/csslogin.css">
  13. </head>
  14. <body>
  15. <div class="divmeioimg">
  16. <img src="/img/logo_34.jpg">
  17. </div>
  18. <div class="large-12 columns">
  19. <form method="POST" action="login.php">
  20. <h5 style='font-style:italic;' align="center">Login</h5>
  21. <div>
  22. Usuário:<input type="text" name="usuario" >
  23. </div>
  24. <div>
  25. Senha:<input type="password" name="password" >
  26. </div>
  27. <input type="submit" class="button" value="Login"/> 
  28. </form>
  29. </div>
  30. </body>
  31.  
  32. <?php
  33. require_once 'init.php';
  34.  
  35. if(isset($_POST['usuario']) and isset($_POST['password'])){
  36.  
  37. require_once('session/db.class.php');
  38.  
  39. $user = ($_POST['usuario']);
  40. $pass = ($_POST['password']);
  41.  
  42. $sql = db::query("SELECT * FROM SISWEBUSU WHERE Dslogin = '".$user."' AND DsSenha = '".$pass."'");
  43.  
  44. if(count($sql) > 0){
  45. require_once('session/session.class.php');
  46. $id = sessao::iniciar();
  47. sessao::set_var('hash_id',md5(gethostbyaddr($_SERVER['REMOTE_ADDR'])));
  48. sessao::set_var('sessao',$id);
  49. sessao::set_var('id_usuario',$sql[0]['DsSenha']);
  50. header("Location: view/home.php");
  51. exit();
  52. }else{
  53. header("Location: index.php");
  54. exit();
  55. }
  56. }else{
  57.  
  58. header("Location: index.php");
  59. exit();
  60. }
  61.  
  62. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement