Advertisement
Guest User

Untitled

a guest
Nov 11th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. <?php
  2. $user = "root";
  3. $pass = "password";
  4.  
  5. $error = "<div class='alert red'>Your login credentials are incorrect!</div>Your login credentials are incorrect!";
  6. $success = "<div class='alert green'>You have been successfully logged in!";
  7. ?>
  8.  
  9. <html>
  10. <head>
  11. <style>
  12. .container {
  13. width: 75%;
  14. height: 100px;
  15. margin: auto;
  16. position: fixed;
  17. top: 0;
  18. left: 0;
  19. bottom: 0;
  20. right: 0;
  21. }
  22.  
  23. .wrapper {
  24. width: auto;
  25. height: auto;
  26. padding: 20px;
  27. background-color: rgba(0, 0, 0, .75);
  28. border: 1px solid #FFF;
  29. color: #FFF;
  30. }
  31.  
  32. input[type="text"],
  33. input[type="password"] {
  34. outline: none;
  35. border: 1px solid #FFF;
  36. background-color: rgba(255, 255, 255, .1);
  37. padding: 5px;
  38. font-size: 16px;
  39. color: #FFF;
  40. }
  41.  
  42. input[type="submit"] {
  43. background-color: rgb(0, 0, 0);
  44. border: 1px solid #FFF;
  45. color: #FFF;
  46. padding: 6px 10px;
  47. outline: 0;
  48. opacity: .7;
  49. margin-left: 10px;
  50. transition: all .3s ease;
  51. }
  52.  
  53. input[type="submit"]:hover {
  54. opacity: 1;
  55. cursor: pointer;
  56. transition: all .3s ease;
  57. }
  58.  
  59. input:-webkit-autofill,
  60. input:-webkit-autofill:hover,
  61. input:-webkit-autofill:focus {
  62. border: 1px solid rgba(255, 255, 0, .5);
  63. -webkit-text-fill-color: white;
  64. -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 0, .1) inset;
  65. transition: background-color 5000s ease-in-out 0s;
  66. }
  67.  
  68. .u {
  69. font-size: 18px;
  70. padding-right: 5px;
  71. }
  72.  
  73. .alert {
  74. padding: 8px;
  75. border: 1px solid rgba(0, 0, 0, .3);
  76. width: 50%;
  77. margin: auto;
  78. margin-top: 20px;
  79. }
  80.  
  81. .green {
  82. background-color: rgba(0, 165, 135, .6);
  83. }
  84.  
  85. .red {
  86. background-color: rgba(200, 50, 50, .6);
  87. }
  88.  
  89. form {
  90. margin: 0 !important;
  91. }
  92. </style>
  93. </head>
  94.  
  95. <body style="background: #000 url(https://i.imgur.com/i6UT7ND.jpg) no-repeat bottom center fixed; font-family: sans-serif;">
  96. <?php
  97. session_start();
  98.  
  99. if(!isset($_SESSION["username"])){
  100. if(isset($_POST["password"]) && isset($_POST["username"])){
  101. $username = $_POST["username"];
  102. $password = $_POST["password"];
  103. }
  104.  
  105. ?>
  106.  
  107. <div class="container">
  108. <div class="wrapper">
  109. <center>
  110. <form method="post">
  111. <span class="u"> Username</span>
  112. <input type="text" name="username" method="post" style="margin-right: 20px;">
  113. <span class="u"> Password</span>
  114. <input type="password" name="password" method="post">
  115. <input type = "submit" value = "Login">
  116. </form>
  117.  
  118. <?php
  119. }
  120. ?>
  121.  
  122. <?php
  123. if(isset($username) && isset($password)){
  124.  
  125.  
  126. if($username == $user && $password == $pass) {
  127. echo $success;
  128. } else if ($username != $user && $password == $pass) {
  129. echo $error;
  130. } else if ($password != $user && $username == $pass) {
  131. echo $error;
  132. } else if ($username != $user && $password != $pass) {
  133. echo $error;
  134. }
  135. }
  136. ?>
  137.  
  138. </center>
  139. </div>
  140. </div>
  141. </body>
  142. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement