Below you can see a short script that causes to write somthing you enter a form to a file. Each entry is appended in new line.<form method=post><input name=a><input type=submit></form>
<?php
if($_POST['a'])file_put_contents('z.txt',$_POST['a']."\n",FILE_APPEND);