Advertisement
Guest User

Untitled

a guest
Jun 4th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $username = "someuser";
  5.  
  6. $password = "somepassword";
  7.  
  8.  
  9.  
  10. if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
  11.  
  12.  
  13.  
  14. ?>
  15.  
  16.  
  17.  
  18. <h1>Login</h1>
  19.  
  20.  
  21.  
  22. <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  23.  
  24. <p><label for="txtUsername">Username:</label>
  25.  
  26. <br /><input type="text" title="Enter your Username" name="txtUsername" /></p>
  27.  
  28.  
  29.  
  30. <p><label for="txtpassword">Password:</label>
  31.  
  32. <br /><input type="password" title="Enter your password" name="txtPassword" /></p>
  33.  
  34.  
  35.  
  36. <p><input type="submit" name="Submit" value="Login" /></p>
  37.  
  38.  
  39.  
  40. </form>
  41.  
  42.  
  43.  
  44. <?php
  45.  
  46.  
  47.  
  48. }
  49.  
  50. else {
  51.  
  52.  
  53.  
  54. ?>
  55.  
  56.  
  57.  
  58. <p>This is the protected page. Your private content goes here.</p>
  59.  
  60.  
  61.  
  62. <?php
  63.  
  64.  
  65.  
  66. }
  67.  
  68.  
  69.  
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement