Advertisement
Guest User

Untitled

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