If you, or someone else, don´t want to give me a push in the right direction, don´t bother to post a reply.
I already have.
The key word is simple, and this is what I have in mind:
form.php
<form action="edit.php" method="post">
<textarea name="testform" rows="3" cols="40"></textarea>
<input type="submit" name="submit" value="submit">
</form>
edit.php
<?php
$filename = 'test.txt';
$content = $_POST['testform'];
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// In our example we're opening $filename in write mode,
// with the pointer at the top, and the file truncated.
// The file is also opened in Binary mode.
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'w+b')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $somecontent to our opened file.
if (fwrite($handle, $content) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($content) to file ($filename)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
?>
A textfile named "test.txt" must already exist.
You run "form.php", type something such as "hello world!" into the textarea, and then submit it.
You should receive a message like:
Success, wrote (hello world!) to file (test.txt)
After which you should open test.txt and confirm this.
Now that you know both the form and the processing page works, you can start to modify the form to the complexity that you want.
If at any time something should go wrong, you compare the new version with an older version that is known to work, and from there determine the problem.