Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1.             <?php
  2.             if ( isset ($_POST['submit'])) {
  3.                 if ( (!empty ($_POST['username'])) && (!empty ($_POST['password'])) ) {
  4.                     if ($_POST['username'] == 'testing' && $_POST['password'] == 'testpass') {
  5.                         print "Logged in as {$_POST['username']}";
  6.                     } else {
  7.                         print "You have the wrong username and/or password. Please fix this or stop trying to hack."
  8.                     }
  9.                  } else {
  10.                 print "I'm sorry but you have forgotten a field. Please fill the form out and try again.";
  11.             } else {
  12.                 print '<form action="login.php" method="post">
  13.                 Username: <input type="text" name="username" size="20">
  14.                 Password: <input type="password" name="password" size"20">
  15.                 Confirm Password: <input type="confirm" name="confirm" size"20">
  16.                 Email: <input type="text" name="email" size"20">
  17.                 <input type="submit" name="submit" value "Log In!" />
  18.                 </form>';
  19.                 }
  20.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement