OK, this is very quickly throw together, and there is absolutely no error checking, but it will get you started. I recommend you look at the file() functions in the PHP manual for more information.
Here is a basic form on the first page...
<FORM METHOD="POST" action="test2.php">
Data 1<input type="text" name="data1"><BR/>
Data 2<input type="text" name="data2"><BR/>
<input type="hidden" name="ipaddy" value="<?PHP echo $_SERVER['REMOTE_ADDR']; ?>">
<input type="submit">
</FORM>
Here is a basic input onto a flat *.txt file. Each time the above form is submitted, it appends your data onto a new line at the end. (I called this file test2.php, and it is in the same directory as the form page.) Also, you don't need to create the text file. If it isn't there, the script will attempt to create it for you. REMEMBER, I built NO error checking into this whatsoever. It works as I have it posted on my machine locally.
<?php
$filename = "./writeonme.txt";
$somecontent = $_POST['data1']."|".$_POST['data2']."|".$_POST['ipaddy']."\r\n";
$handle = fopen($filename, 'a+b');
fwrite($handle, $somecontent);
fclose($handle);
?>
P.S. I am going to bed now, so if you need more help with this, I will check in tomorrow.