Advertisement
Guest User

Untitled

a guest
Sep 20th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php
  2.     function login($username, $password) {
  3.         if($username == "Admin" && $password == "p4ssM3") {
  4.             return true;
  5.         }
  6.         else {
  7.             return false;
  8.         }
  9.     }
  10.     if (isset($_POST['username']) && isset($_POST['password']) {
  11.         $login = login($_POST['username'], $_POST['password']);
  12.     }
  13.     else {
  14.         $login = false;
  15.     }
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. <head>
  20.     <meta charset="utf-8" />
  21.     <title>Login</title>
  22. </head>
  23.  
  24. <body style="background:url('login.jpg');color:white;">
  25. <?php
  26.     if ($login == true) {
  27. ?>
  28.     <h1 style="text-align:left;font-weight:bold;test-decoration:underline;">Panel</h1>
  29.     <p>
  30.         <h3>Username: <?= $_POST['username']; ?></h3>
  31.     </p>
  32. <?php
  33.     }
  34.     else {
  35. ?>
  36.     <h1 style="text-align:left;font-weight:bold;test-decoration:underline;">Login</h1>
  37.     <form method="post">
  38.         <input type="text" name="username" />
  39.         <input type="password" name="password" />
  40.         <p>
  41.             <input type="submit" value="Log In" />
  42.         </p>
  43.     </form>
  44. <?php
  45.     }
  46. ?>
  47. </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement