Guest User

Untitled

a guest
Apr 7th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2.  
  3. $username = "eric";
  4. $password = "poop";
  5.  
  6. if ($_POST['username'] != $username || $_POST['password'] != $password) {
  7.  
  8. ?>
  9.  
  10. <div id="login">
  11.  
  12. <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  13.  
  14. <ul>
  15. <li><input type="text" name="username"></li>
  16. <li><input type="password" name="password"></li>
  17. <li class="submit"><input class="submit" type="submit" name="submit" value="login"></li>
  18. </ul>
  19. </form>
  20. </div>
  21.  
  22. <?php
  23.  
  24. }
  25.  
  26. else {
  27.  
  28. $handle = opendir('/home/elekchron/artoferichu.com/files/');
  29.  
  30. print('<div id="files"><ul>');
  31. while ($file = readdir($handle)) {
  32.  
  33. if ($file == "index.php") {
  34. break;
  35. }
  36.  
  37. else {
  38. print('<li><a href="/files/' . $file . '">' . $file .'</a></li>' . "\n");
  39. }
  40.  
  41. }
  42. print('</ul></div>');
  43.  
  44. }
  45.  
  46. ?>
Add Comment
Please, Sign In to add comment