Basically, I was trying to find a simple piece of code for a simple note taking thing in html, I want to type in an html input form, then that input be added on to a text file i found this,
<h1>Adding a text block to a text file:</h1>
<form action="index.php" method='post'>
<textarea name='textblock'></textarea>
<input type='submit' value='Add text'>
</form>
<?php
// Open the text file
$f = fopen("text.html", "a");
// Write text
fwrite($f, $_POST["textblock"]);
// Close the text file
fclose($f);
// Open file for reading, and read the line
$f = fopen("text.html", "r");
// Read text
echo fgets($f);
fclose($f);
?>
Which works, but needs line breaks at the end of the output, such as if i wrote "test" and then "test" again, it outputs as "testtest" obviously, but I want two line breaks between them, like
"Test
Test"
I also want to add another input called "Subject" which will be the subject of the note,I'm open to any suggestions, if this code is wrong, or over complicated, then feel free to shorten it or just give me a entirely new one.
Thanks for any help
Terry.