Advertisement
Guest User

Untitled

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