OK. to use fwrite, you need to first create a filestream.
if (isset($_POST['submit']) && $_POST['newline'])
{
$handle=fopen($path,"a");
$contents .= "\r\n" . stripslashes(trim($_POST['newline']));
fwrite($handle, $contents) or exit('error writing to file');
fclose($handle);
}
and I am assuming that you want to append the line, not overwrite....