Advertisement
Guest User

Untitled

a guest
May 28th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. <html>
  2. <?php
  3. session_start();
  4. //ini_set('display_errors', 0);
  5. require 'scripts/login.php';
  6. require 'scripts/display_comments.php';
  7. $username = $_SESSION['username'];
  8. $password = $_SESSION['password'];
  9. if($username && $password)
  10. {
  11. ?>
  12. <head>
  13. <link rel="stylesheet" type="text/css" href="stylesheet2.css" />
  14. </head>
  15. <body>
  16. <?php
  17. echo "<table id='filelist'>";
  18. echo "<tr>";
  19. echo "<th>File</th>";
  20. echo "</tr>";
  21.  
  22. //chdir("../");
  23. echo getcwd().$_GET["filepath"]."<br/>";
  24. chdir(getcwd().$_GET["filepath"]);
  25.  
  26. if ($handle = opendir(getcwd())) {
  27. while (false !== ($file = readdir($handle))) {
  28. if ($file != "." && $file != "..") {
  29. echo "<tr class='alt'>";
  30. echo "<td>".$file."</td>";
  31. echo "</tr>";
  32. }
  33. }
  34. closedir($handle);
  35. }
  36. ?>
  37. <script type="text/javascript" src="scripts/jquery.js"></script>
  38. <script type="text/javascript">
  39. $("td").mouseenter(function(){
  40. $(this).css("background-color", "#999");
  41. })
  42. $("td").mouseleave(function(){
  43. $(this).css("background-color", "#EAF2D3");
  44. })
  45. $("td").click(function(){
  46. $.ajax({
  47. type: "GET",
  48. url: "files.php",
  49. data: 'filepath='+String.fromCharCode(92)+$(this).text(),
  50. cache: false,
  51. success: function(html){
  52. $("#content").html(html);
  53. }
  54. });
  55. })
  56. </script>
  57. </body>
  58. <?php
  59. }
  60. else
  61. {
  62. echo "You must be logged in to access this content!";
  63. }
  64. ?>
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement