diff options
Diffstat (limited to 'edittext.php')
-rw-r--r-- | edittext.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/edittext.php b/edittext.php new file mode 100644 index 0000000..961cea4 --- /dev/null +++ b/edittext.php @@ -0,0 +1,21 @@ +<?php
+session_start();
+$fieldname = $_REQUEST['fieldname'];
+$encrypt_pass = @file_get_contents('files/password');
+if ($_SESSION['l'] != $encrypt_pass) {
+ header('HTTP/1.1 401 Unauthorized');
+ exit;
+}
+
+$content = trim(rtrim(stripslashes($_REQUEST['content'])));
+
+$file = @fopen("files/$fieldname", "w");
+if (!$file) {
+ echo "Editing failed. Set correct permissions (755) to the 'files' folder.";
+ exit;
+}
+
+fwrite($file, $content);
+fclose($file);
+echo $content;
+?>
|