Simple Lightweight Open Source PHP editor of txt files

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Try this:


<?php

// configuration
$url = 'http://www.leonli.co.uk/path-to-editor.php'; //change this to your php file path
$file = '/path/to/file'; //change this to your target file path

// check if form has been submitted
if (isset($_POST['text']))
{
    // save the text contents
    file_put_contents($file, $_POST['text']);

    // redirect to form again
    header(sprintf('Location: %s', $url));
    printf('<a href="%s">Moved</a>.', htmlspecialchars($url));
    exit();
}

// read the textfile
$text = file_get_contents($file);

?>
<!-- HTML form -->
<form action="" method="post">
<textarea style="width:700;height:200;" name="text"><?php echo htmlspecialchars($text) ?></textarea>

<input type="submit" />
<input type="reset" />
</form>

Read More