Guest User

Untitled

a guest
Mar 3rd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2. $username = "someuser";
  3. $password = "somepassword";
  4.  
  5. if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
  6.  
  7. ?>
  8.  
  9. <h1>Login</h1>
  10.  
  11. <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  12. <p><label for="txtUsername">Username:</label>
  13. <br /><input type="text" title="Enter your Username" name="txtUsername" /></p>
  14. <p><label for="txtpassword">Password:</label>
  15. <br /><input type="password" title="Enter your password" name="txtPassword" /></p>
  16. <p><input type="submit" name="Submit" value="Login" /></p>
  17. </form>
  18. <?php
  19. }
  20. else {
  21. ?>
  22.  
  23. <p>This is the protected page. Your private content goes here.</p>
  24.  
  25. <?php
  26. }
  27. ?>
Add Comment
Please, Sign In to add comment