here's a sort of proof of concept implementation of what i was talking about. you could use another page for logins and check the referrer on this page to make sure the referrer is your login page. if it isn't redirect users to the log in page.
the script will open any kind of file (html, php, txt) in any subfolder. should work for parent folders by doing ../file, too. you can select files via the querystring (edit.php?file=news.txt) or you can open files by typing the name in the input box at the top. The break in the indention in the middle (where it actually reads/writes the file) is to prevent adding extraneous spaces to the file. if that line is indented like the others, the first line of the file will be indented by that same amount (because that area is inside the textarea tag). hope this helps! let me know if you want any more help with it. oh, and it will create new files as well, if they don't exist. you could modify it so that it will warn if creating a new file.
(it works on my testbox, but i just tried it on my host, and the file write fails. not sure why, but its probably a server config thing.)
<html>
<head>
<title>Edit</title>
</head>
<body>
<form method=post>
<input value="<?php $tmp=($_POST["file"])?$_POST["file"]:$_GET["file"]; echo $tmp;?>" name="file">
<input value="Open File" type=submit><hr><p>
<?php
if ($_POST["submit"]=="submit") { // begin if statement
if (@fwrite(@fopen($_POST["file"],"wb"), $_POST["filetext"])) {
echo "File write successful";
} else {
echo "File write unsuccessful";
}
} else { //begin else block ?>
<textarea name=filetext rows=30 cols=90 wrap="off">
<?php echo @fread(@fopen($tmp,"r"), @filesize($tmp));?>
</textarea>
<input name=submit value=submit type=submit>
<?php } //end if statement?>
</form>
</body>
</html>