What's Here?
- Members: 148,673
- Replies: 504,786
- Topics: 79,485
- Snippets: 2,661
- Tutorials: 705
- Total Online: 1,597
- Members: 85
- Guests: 1,512
|
|
Submitted By: SpaceMan
|
|
Rating:

|
|
Views: 15,041 |
Language: PHP
|
|
Last Modified: March 13, 2005 |
Instructions: chmod the file to edit 0666.
will edit files with textarea. |
Snippet
<?php
$loadcontent = "my_edit_file.php";
if($save_file) {
$fp = @ fopen($loadcontent, "w");
if ($fp) {
print '<a href='. $_SERVER[PHP_SELF ]. '>Refresh</a>';
print "<html><head><META http-equiv=\"refresh\" content=\"0;URL=$_SERVER[PHP_SELF]\"></head><body>";
}
}
$fp = @ fopen($loadcontent, "r");
$lines = explode("\n", $loadcontent);
for ($a = 1; $a < $count+1; $a++) {
$line .= "$a\n";
}
?>
<form method=post action="<?=$_SERVER[PHP_SELF]?>">
<input type="submit" name="save_file" value="Save">
<table width="100%" valign="top" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="3%" align="right" valign="top"><pre style="text-align: right; padding: 4px; overflow: auto; border: 0px groove; font-size: 12px" name="lines" cols="4" rows="<?=$count+3;?>"><?=$line;?></pre></td>
<td width="97%" align="left" valign="top"><textarea style="text-align: left; padding: 0px; overflow: auto; border: 3px groove; font-size: 12px" name="savecontent" cols="150" rows="<?=$count;?>" wrap="OFF"><?=$loadcontent?></textarea></td>
</tr>
</table>
<br>
<input type="submit" name="save_file" value="Save">
</form>
Copy & Paste
|
|
|
Be Social
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|