SHARE
TWEET

Untitled

a guest Apr 17th, 2013 1,663 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ cat /var/www/login.php
  2. <?php
  3.   $username = 'admin';
  4.   $password = 'kjhjkhgjhkgkhjgkjhgjkhgkjhgjkhgjkhgjhkghjkgkjgkjhgjkgh';
  5. ?>
  6.  
  7. <html>
  8. <head></head>
  9.  
  10. <body>
  11.  
  12. <?php
  13.  
  14.  if (!isset($_POST['submit'])) {
  15.  
  16.    echo '<form action="#" method="post">
  17.           Username: <input type="text" name="username" /> <br />
  18.           Password: <input type="password" name="password" /> <br />
  19.           <input type="submit" name="submit" value="Submit" />
  20.         </form>';
  21.  
  22.  } else {
  23.  
  24.    if (($_POST['username'] === $username) && ($_POST['password'] === $password)) {
  25.      echo 'Welcome!';
  26.    } else {
  27.      echo 'Incorrect username and/or password!';
  28.    }
  29.  
  30.  }
  31.  
  32. ?>
  33.  
  34. </body>
  35.  
  36. </html>
RAW Paste Data
Top