Hi blckspdr,
Here is a sample of what I do to write a text file out.
$name = $_POST['name'];
$subject = $_POST['subject'];
$comments = $_POST['comments'];
$filename = $name . ".txt";
//Make the body copy
$body = "$name\r\n"
. "$subject\r\n"
. "$comments";
$fp = fopen($filename, 'a+') or die("Couldn't open ".$filename);
if (!$fp)
{
echo '<p><strong>There is a problem. I cannot write to the file.</strong></p>';
echo '<p><strong> Please try again later.</strong></p></body></html>';
exit;
}
// Write out the text data
fwrite($fp, $body));
fclose($fp);
But the challenge is, that the file must exist on the server and you need full read write permissions (ie, 777 if you get info with your FTP program, and check the permissions for the owner, group and world) for this to work.
Otherwise your close.
I did not test my code, I stripped out my 'customization' of it, so try it and see if it does what you want.
Dont forget to create a text file (with wordpad and save as text, no rtf) and put that file in the same directory as you test file, and set the permisions.
Don