PHP edit files Script
Hey, i made a script that i use often to edit files, so i dont have to use FTP everytime i want to edit a script, here's the code:
<textarea name="content" width="100%" height="100%" style="width:100%;height:750px;background-color:black;color:LightSlateGrey;font-size:12px;" wrap="logical" rows="21" cols="40">
<?php
$file = $_GET['file'];
if(isset($_GET['file'])){
$x = @file_get_contents($file);
if( !$x ){
echo ('No file selected or no data!');
} else {
echo htmlentities(file_get_contents($file));
}
if(isset($_POST['content'])){
$content = $_POST['content'];
$filew = fopen($file, "w+");
fwrite($filew,stripslashes($content));
fclose($filew);
}}
?>
</textarea>
<br><br>
<center>
<input type="submit" value="Edit!" style="height:20px;"> <input type="reset" value="Reset" style="height:20px;">
</form>
</center>```
you can test it here:
http://lolzor.t35.com/edit.php?file=testfile.txt
just a free host i set up, ads and shit..
ok, post your suggestions/improvements or what you think, i'm PHP noob..
*HackingForce~*
-
you don't need a "New file" option..just start coding and click Edit, the file will automatilly get created
-
what's the point of checking if the file is it self, when you can just make a new one that would fuck it, IF that's what you want to do..
-
the point is to use it so you don't have to upload files via FTP each and everytime you want to edit something, not to be a fucking noob and delete the script!
god damn..
HackingForce wrote:
-
you don't need a "New file" option..just start coding and click Edit, the file will automatilly get created
-
what's the point of checking if the file is it self, when you can just make a new one that would fuck it, IF that's what you want to do..
-
the point is to use it so you don't have to upload files via FTP each and everytime you want to edit something, not to be a fucking noob and delete the script!
god damn..
Erh, I didn't delete the script. In the case you weren't talking to me: I still didn't delete it.