form to text file

They have: 5,633 posts

Joined: Jan 1970

I'm extremely green at php, so could someone please take a look at what I am doing to see if I am opening up the server to hack and attack.

I want info from Jack's formmail to be emailed to me, and also to be added to a text file on the server. The script aready emailed info to me, of course. So, I experimented and added the following to the formmail.php in order to also put the info into file.txt on the server:

------------
$writestring = "\"" . $name . "\",\"" . $phone . "\",\"" . $email . "\",\"" . $date . "\",\"" . $comments . "\"\r\n";

//form fields are name, phone, email, date, comments

$filepointer = fopen("file.txt","a"); //appends to end of file
fwrite($filepointer,$writestring);
fclose($filepointer);
--------------

It works just fine. And since it is inside Jack's script I think everything is safe. Is there anything I should add or do to make sure this is not endangering anything. Like I said, I'm dumb about this. I cobbled this together with a little advice and baling wire.

thanks