PHP secure writing to a text file?
<p>An HTML form, a php file and a text file.</p>

<p>The form has one input box, it sends the inputted string to the PHP file using GET or POST.  The PHP file writes the string to the text file using <code>fopen 'a'</code>, <code>fwrite</code> and <code>fclose</code> and does no sanitization at all.</p>

<p>The text file is set to permission 777 and is in the same folder as the other files.</p>

<p>Are there any security concerns here?  Is it possible for someone to send something using the form that will do any damage?  If yes, what?</p>

<p>What about if the txt file is set to 666?</p>
