Guest User

asd

a guest
Dec 23rd, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. <html lang="de">
  2. <head>
  3. <meta charset="utf-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Bootstrap 101 Template</title>
  7.  
  8. <!-- Bootstrap -->
  9. <link href="css/bootstrap.min.css" rel="stylesheet">
  10. <link href="css/fail.css" rel="stylesheet">
  11.  
  12. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  13. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  14. <!--[if lt IE 9]>
  15. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  16. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  17. <![endif]-->
  18. </head>
  19. <body>
  20.  
  21.  
  22. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  23. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  24. <!-- Include all compiled plugins (below), or include individual files as needed -->
  25. <script src="js/bootstrap.min.js"></script>
  26. </body>
  27. </html>
  28.  
  29. <?php
  30. session_start();
  31. include_once("db.php");
  32.  
  33.  
  34. $l_name = $_POST["l_username"];
  35. $l_pw = $_POST["l_password"];
  36.  
  37. $query = "SELECT * FROM user WHERE username = '".$l_name."'";
  38. $result = mysqli_query($db,$query);
  39.  
  40. while ($row = mysqli_fetch_object($result)) {
  41.  
  42. $li_name = $row->username;
  43. $li_pw = $row->password;
  44. }
  45.  
  46. if(mysqli_num_rows($result) == 0)// Kein User vorhanden
  47. {
  48.  
  49. ?>
  50. <html>
  51. <body>
  52.  
  53. <div class="bs-example">
  54. <div class="alert alert-danger alert-error">
  55. <strong>Fehler!</strong> Benutzer wurde nicht gefunden!<br>
  56. <a href="login.html" class = "alert-link"><i>Hier klicken, falls du nicht automatisch weitergeleitet wirst!</i>
  57. </div>
  58. </div>
  59. </body>
  60.  
  61. </html>
  62.  
  63. <?php
  64. header("Refresh:5; url=login.html", true, 303);
  65. }
  66.  
  67. if($li_pw != $l_pw){ // Passwort stimmt nicht
  68. ?>
  69. <html>
  70. <body>
  71.  
  72. <div class="bs-example">
  73. <div class="alert alert-danger alert-error">
  74. <strong>Fehler!</strong> Falsches Passwort eingegeben!<br>
  75. <a href="login.html" class = "alert-link"><i>Hier klicken, falls du nicht automatisch weitergeleitet wirst!</i>
  76. </div>
  77. </div>
  78. </body>
  79.  
  80. </html>
  81.  
  82. <?php
  83. header("Refresh:5; url=login.html", true, 303);
  84.  
  85. }
  86. else{
  87. $_SESSION["loggedname"] = $li_name;
  88. ?>
  89. <html>
  90. <body>
  91.  
  92. <div class="bs-example">
  93. <div class="alert alert-success">
  94. Erfolgreich eingeloggt!<br>
  95. <a href="login.html" class = "alert-link"><i>Hier klicken, falls du nicht automatisch weitergeleitet wirst!</i>
  96. </div>
  97. </div>
  98. </body>
  99.  
  100. </html>
  101.  
  102. <?php
  103. header("Refresh:5; url=main.php", true, 303);
  104. }
  105.  
  106.  
  107. ?>
Advertisement
Add Comment
Please, Sign In to add comment