Advertisement
Guest User

Untitled

a guest
Oct 10th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. // Define your username and password
  3. $username = "USERNAME HERE";
  4. $password = "PASSWORD HERE";
  5. if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
  6. ?>
  7. <h1>Login</h1>
  8. You must login to see this private content.<br>
  9. <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  10. <p><label for="txtUsername">Username:</label>
  11. <br /><input type="text" title="Enter your username" name="txtUsername" /></p>
  12. <p><label for="txtpassword">Password:</label>
  13. <br /><input type="password" title="Enter your password" name="txtPassword" /></p>
  14. <p><input type="submit" name="Submit" value="Login" /></p>
  15. </form>
  16. <?php
  17. }
  18. else {
  19. ?>
  20. <p><h1>Hello!</h1>
  21. <br>If you are seeing this, you have logged in successfully.</p>
  22. <?php
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement