
If you want to specify different filenames, overwrite, append, check for bad content/spam etc then you'll need to do more work. All the above will do is write EXACTLY what was posted in the form to a file. WARNING: This is an extremely simplistic answer! You will perhaps want to protect your form and your file, or do some different things. There are 2 major advantages: 1.Your data never transmitted in the Open Internet, so you know it's secure 2.It's much faster than doing all the work in the server side, because. To actually create a file, take a look at the fopen/fwrite commands in PHP, another simplistic example: Does Text Editor Online Tool log my data Absolutely NOT, this Text Editor doing all the formatting work on the client side, all logic are implemented by Javascript. On 'save.php' (or wherever) you can easily see the information sent from the form: It doesn't read the file when printing the form (so every time you want to edit the text, you have to start from scratch), it does not check the input for anything (do you want the user to be able to post HTML?), it has no security check (everyone can access it and alter the file), and in no way it reads the file for display on the page you want.įirst thing to do is capture the information, the simplest way to do this would be the use of a HTML Form with a TEXTAREA: Note that this exactly matches your description. You have posted no single requirement, other than that you want to post a textfield (textarea I mean?) to a TXT file. What did you Google on then? php write file gives me a few million hits.īut to be honest, you should first pick up a PHP book and start trying.
