What's Here?
- Members: 149,581
- Replies: 506,709
- Topics: 79,845
- Snippets: 2,666
- Tutorials: 706
- Total Online: 1,744
- Members: 90
- Guests: 1,654
|
This is just a basic file editor taken from a file manager I made.
This eliminates most of the problems inherent in the other "online file editor" snippet.
|
Submitted By: Styx
|
|
Rating:

|
|
Views: 1,339 |
Language: PHP
|
|
Last Modified: March 22, 2007 |
Instructions: Set $file to the file to be edited.
If the file doesn't exist, it'll be created when you click save. |
Snippet
<?php
$file = 'test.php';
echo '<div style="border: 1px solid; text-align:center;">';
if (isset($_POST['edit']))
{
$handle = fopen($file, 'w');
echo "\n<br />File Updated Successfully!<br />\n";
}
echo '<br /><form method="post">
<textarea name="edit_file" wrap="virtual" cols="90" rows="40">' . $contents . '</textarea>
<br /><br /><input type="submit" name="edit" value="Save"></form>
</div>';
?>
Copy & Paste
|
|
|
Be Social
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|