Advertisement
Infuthronus

Opdracht3

Dec 3rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. ---------------------------------------------INDEX-----------------------------------------------------
  2. <!DOCTYPE html>
  3.  
  4. <?php
  5. session_start();
  6.  
  7. $username = "user";
  8. $password = "password";
  9. $sec = "sec";
  10.  
  11.  
  12. if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] == true) {
  13. header("Location: success.php");
  14. }
  15.  
  16. if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['sec']) ) {
  17. if ($_POST['username'] == $username && $_POST['password'] == $password && $_POST['sec'] == $sec ) {
  18. $_SESSION['logged_in'] = true;
  19. header("Location: success.php");
  20. }
  21. }
  22. ?>
  23.  
  24.  
  25. <html>
  26. <head>
  27. <title>Opdracht 3</title>
  28. <meta charset="utf-8">
  29. <link rel="stylesheet" href="style.css">
  30. </head>
  31.  
  32. <body>
  33. <div class = "wrapper">
  34. <div class="logo">
  35. <img id="img1" src="images/img1.jpg" alt="Umbrella Corp logo">
  36. <h1>Umbrella Corp.</h1>
  37. <h3><i>"Our buisness if life itself."</i></h3>
  38. <p><strong>WARNING:</strong> Unauthorized viewing of anything beyond this screen is violation of Corporation Security Agreement (CSA) and will be punished accordingly.</p>
  39. </div>
  40. <div class="login">
  41. <fieldset>
  42. <form method="post" action="index.php">
  43. <label>Username:</label>
  44. <input type="text" name="username">
  45. <br>
  46. <label>Password:</label>
  47. <input type="password" name="password">
  48. <br>
  49. <label>Sec-code:</label>
  50. <input type="password" name="sec">
  51. <br>
  52. <br>
  53. <input type="submit" value="Login">
  54. </form>
  55. </fieldset>
  56. </div>
  57. </div>
  58. </body>
  59. </html>
  60.  
  61.  
  62. ------------------------------------------------INDEX-CSS--------------------------------------------------
  63. @font-face {
  64. font-family: myFont1;
  65. src: url("fonts/cour.ttf");
  66. }
  67.  
  68. body {
  69. background-color: black;
  70. font-family: myFont1;
  71. color: white;
  72. }
  73.  
  74. .logo {
  75. text-align: center;
  76. float: left;
  77. margin-right: 5%;
  78. margin-top: 2%;
  79. width: 35%;
  80. }
  81.  
  82. #img1 {
  83. margin-top: 7%;
  84. }
  85.  
  86. .login {
  87. float: right;
  88. background-color: silver;
  89. color: black;
  90. margin-top: 20%;
  91. margin-right: 30%;
  92. }
  93.  
  94. input[type="submit"] {
  95. font-family: myFont1;
  96. }
  97.  
  98. fieldset {
  99. border: 0;
  100. }
  101.  
  102. ------------------------------------------------SUCCESS-----------------------------------------------------
  103.  
  104. <?php
  105. session_start();
  106. if (!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] == false ) {
  107. header("Location: index.php");
  108. }
  109. session_destroy();
  110. ?>
  111.  
  112. <h2>Ura!</h2>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement