Advertisement
Guest User

Untitled

a guest
Mar 10th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. authenticate.php?username={$_GET['username']}&password={$_GET['password']}
  2.  
  3.  
  4. if ($_GET['username'] == "secret_username" && password == "secret_password")
  5. {
  6. $_SESSION['user'] = $username;
  7. header("Location: password_protected_page.php");
  8. exit;
  9. }
  10.  
  11. <?php
  12.  
  13. $filename = "/home/users.txt";
  14. $file = fopen( $filename, "r" );
  15. $display = fread( $file, filesize( $filename ) );
  16. fclose($file);
  17.  
  18. ?>
  19.  
  20. /root/users.Joe.php
  21. /root/users/Juan.php
  22. /root/users/Tim.php
  23.  
  24. <?php
  25. $userpath='/var/www/html/users/Tim';
  26. $password='Timspassword';
  27. ?>
  28.  
  29. <?php
  30. include '/root/users/'.$_POST[username];
  31. if ($password == $_POST['password'])
  32. {
  33. $_SESSION['loggedin']='yes';
  34. $_SESSION['expire']='<how much time you need?>';
  35. }
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement