Guest User

Untitled

a guest
Sep 2nd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 KB | None | 0 0
  1. <?php ob_start(); session_start(); ?>
  2.  
  3. <html>
  4. <head>
  5. <title>Login</title>
  6. <link href="login.css" rel="stylesheet" type="text/css">
  7. </head>
  8.  
  9.  
  10.  
  11. <!--
  12. <body>
  13.  
  14. Werbungsabfänger
  15.  
  16. </body>
  17. -->
  18.  
  19. <body>
  20.  
  21. <?php
  22.  
  23. $host = "localhost";
  24. $user = "sportef";
  25. $pass = "65fci7ztf9";
  26. $dbname = "sportef";
  27. $db = new PDO("mysql:host=$host; dbname=$dbname", $user, $pass);
  28.  
  29.  
  30.  
  31.  
  32. if(isset($_POST['submit']))
  33. {
  34. //Variablen anlegen
  35. $username = $_POST['username'];
  36. $passwort = $_POST['passwort'];
  37. $checkOk = true;
  38.  
  39. $fail = "Die eingegebene Benutzername/Password Kombination ist nicht korrekt.";
  40. $id = $db->query("SELECT `activateid` FROM `Benutzer` WHERE `Benutzername` = '$username'");
  41. $rows2 = $id->fetch();
  42. //Post Inhalte überprüfen
  43. if(empty($username))
  44. {
  45. $checkOk = false;
  46. echo "Bitte geben sie einen Benutzernamen ein.<br>";
  47. }
  48. if(empty($passwort))
  49. {
  50. $checkOk = false;
  51. echo "Bitte geben sie ein Passwort ein.<br>";
  52. }
  53. if($rows2['activateid'] != "")
  54. {
  55. $checkOk = false;
  56. echo "Bitte aktiviere deinen Acount.<br>";
  57. }
  58.  
  59.  
  60. //Wenn Post Inhalte keine Fehler enthalten
  61. if($checkOk)
  62. {
  63.  
  64. $passwort = md5($passwort);
  65. $query = $db->query("SELECT `Benutzername`, `Passwort` FROM `Benutzer` WHERE `Benutzername`='$username' AND `Passwort`='$passwort' LIMIT 1");
  66.  
  67. $nums = $query->rowCount();
  68.  
  69. //Überprüfen
  70. if($nums > 0 && $username != "Klinger Volker" && $username != "MarvinAdmin")
  71. {
  72.  
  73. $_SESSION['Benutzername'] = $username;
  74. Header("Location: daten.php");
  75. ob_end_flush();
  76. }
  77. elseif($nums <= 0)
  78. {
  79. echo $fail;
  80. }
  81. elseif($username = "Klinger Volker" || $username = "MarvinAdmin" )
  82. {
  83. $_SESSION['Benutzername'] = $username;
  84. Header("Location: datenadmin.php");
  85. ob_end_flush();
  86. }
  87. }
  88. else
  89. {
  90. echo " ";
  91. }
  92.  
  93. }
  94. ?>
  95. <form method='POST'>
  96. <h1>Stiftisches Gymnasium <br>Sport EF/10</h1>
  97.  
  98. <span style="color: #40ffff">Benutzername:</span><br>
  99. <input type='text' name='username'><br><br>
  100.  
  101. <span style="color: #40ffff">Passwort:</span><br>
  102. <input type='password' name='passwort'><br><br>
  103.  
  104. <input type='submit' value='Login' name='submit'><br><br><br><br><br>
  105.  
  106. </form>
  107.  
  108. <big><small>Wenn Ihr noch nicht registriert seid, k&ouml;nnt Ihr das <a href="registrierung.php">hier</a> tun.</small></big>
  109.  
  110.  
  111.  
  112. <div id="footer">
  113. <hr>
  114. 2012 &#169; Marvin Wirtz || <a href="impressum.php">Impressum</a>
  115. </div>
  116.  
  117.  
  118.  
  119. </body>
  120. </html>
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. body{
  130. background-color: #808080;
  131. background:url(Untitled-1.jpg);
  132. color: #40ffff;
  133. font-size: 40px;
  134. text-align: center;
  135. font-family: Georgia,
  136. }
  137.  
  138.  
  139. table { background: transparent; }
  140.  
  141.  
  142. form{
  143. font-size: 35px;
  144. text-align: center;
  145. }
  146.  
  147.  
  148. input{
  149. color:#000000;
  150. font-size: 35px;
  151. text-align: center;
  152. }
  153.  
  154. h1{
  155. color:#40ffff;
  156. font-size:50px;
  157. }
  158.  
  159. big{
  160. color:#40ffff;
  161.  
  162. }
  163.  
  164. span{
  165. color:#40ffff;
  166. }
  167.  
  168. a{
  169. color:#40ffff;
  170. }
  171.  
  172. html, body {
  173. margin:0;
  174. padding:0;
  175. height:100%;
  176. overflow:hidden;
  177. }
  178.  
  179.  
  180. #footer {
  181. position:fixed;
  182. bottom:0px;
  183. text-align:center;
  184. padding:10px;
  185. width:100%;
  186. font-size:18px;
  187. }
Add Comment
Please, Sign In to add comment