View previous topic :: View next topic |
Author |
Message |
Dark‮‮ Advanced Cheater
Reputation: 5
Joined: 16 Jun 2011 Posts: 79 Location: <3
|
Posted: Thu May 24, 2012 1:00 am Post subject: cryoma |
|
|
Can you make a php thingy what will edit a file on my server?
|
|
Back to top |
|
 |
Zacky Grandmaster Cheater
Reputation: 19
Joined: 23 Nov 2008 Posts: 808
|
Posted: Thu May 24, 2012 1:09 am Post subject: Re: cryoma |
|
|
Sterling Archer wrote: | Can you make a php thingy what will edit a file on my server? |
If he's giving you access to the ftp, can't you just edit the file yourself?
|
|
Back to top |
|
 |
Dark‮‮ Advanced Cheater
Reputation: 5
Joined: 16 Jun 2011 Posts: 79 Location: <3
|
Posted: Thu May 24, 2012 2:08 am Post subject: |
|
|
Need to edit a local file, not a file in the http directory.
He isn't giving me anything, I'm referring to a server i have lying around.
|
|
Back to top |
|
 |
PUSHEAX_PUSHEAX Grandmaster Cheater
Reputation: 72
Joined: 13 Apr 2009 Posts: 969
|
Posted: Thu May 24, 2012 2:12 am Post subject: |
|
|
Give me a sec.
|
|
Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Thu May 24, 2012 2:15 am Post subject: |
|
|
Specifically?
|
|
Back to top |
|
 |
PUSHEAX_PUSHEAX Grandmaster Cheater
Reputation: 72
Joined: 13 Apr 2009 Posts: 969
|
Posted: Thu May 24, 2012 2:55 am Post subject: |
|
|
Hate on my code if you want, it wasn't a big production. I got the job done. Also OP (or anyone else, for gods sake don't give this link to anyone who you don't trust 100%).
Usage:
save as browser.php {or any name, just with .php}
navigate to domain.tld/browser.php?handle=fileName.txt
to edit the file named fileName.txt for example.
Code: | <?php
/**
* Local file editor
* @author www.salazar.tv & www.phpal.in
*
* DEVELOPER PLEASE NOTE
* You may edit and/or improve it any further it as long as you do not remove the original author name.
*
**/
if (isset($_POST['edit'])) {
$changes = $_POST['changes'];
$fileName = htmlspecialchars($_POST['fileName']);
$handle = fopen($fileName, 'w+');
$write = fwrite($handle, $changes) or die ('Failed to edit the file, please try again');
fclose($handle);
if ($write) {
echo "The file was successfully edited!";
}
} else {
$fileName = htmlspecialchars($_GET['handle']);
if (file_exists($fileName) && is_readable($fileName)) {
echo "The name of the file you are editing is: $fileName";
$handle = fopen($fileName, 'r');
$contents = @fread($handle, filesize($fileName));
echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"POST\">";
echo "<br /><textarea rows=\"50%\" cols=\"90%\" name=\"changes\">";
echo $contents;
echo "</textarea>";
?>
<input type="submit" value="Edit file" name="edit">
<input type="hidden" name="fileName"
value="<?php echo $fileName; ?>">
</form>
<?php
fclose($handle);
} else {
echo "The file you have requested to edit either does not exist or is not readable, if you are sure it exists check your permissions.";
}
}
?> |
|
|
Back to top |
|
 |
PUSHEAX_PUSHEAX Grandmaster Cheater
Reputation: 72
Joined: 13 Apr 2009 Posts: 969
|
Posted: Sat May 26, 2012 1:35 am Post subject: |
|
|
where's my thanks :'(
|
|
Back to top |
|
 |
Dark‮‮ Advanced Cheater
Reputation: 5
Joined: 16 Jun 2011 Posts: 79 Location: <3
|
Posted: Sat May 26, 2012 2:09 am Post subject: |
|
|
nut wut i wunt bbz
looking for something that i can acces like
domain.tld/editor.php
and that will edit a file in like
/home/file.stuff
or in windows talk:
c/program files/file.stuff
|
|
Back to top |
|
 |
PUSHEAX_PUSHEAX Grandmaster Cheater
Reputation: 72
Joined: 13 Apr 2009 Posts: 969
|
Posted: Sat May 26, 2012 3:09 am Post subject: |
|
|
Sterling Archer wrote: | nut wut i wunt bbz
looking for something that i can acces like
domain.tld/editor.php
and that will edit a file in like
/home/file.stuff
or in windows talk:
c/program files/file.stuff |
Is this guy serious?
Maybe you should try it before you assume it doesn't work.
Description: |
|
Filesize: |
183.44 KB |
Viewed: |
7147 Time(s) |

|
|
|
Back to top |
|
 |
Dark‮‮ Advanced Cheater
Reputation: 5
Joined: 16 Jun 2011 Posts: 79 Location: <3
|
Posted: Sat May 26, 2012 1:37 pm Post subject: |
|
|
iiiiiii fucking
love
you
would you sex me?
|
|
Back to top |
|
 |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Sat May 26, 2012 1:57 pm Post subject: |
|
|
Yuck.
|
|
Back to top |
|
 |
|