Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Simple form that appends to a text file

$
0
0

Hi, This is probably something very simple for most of you, but I'm very new to php coding, so thanks in advance for your help!

 

All I'm needing to do is have a one field form on my site that will append the data to a text file.  I have it working, however it enters data into the file immediately after the previous data without a comma or a line break.  This will make it very hard to export later on.

 

Here is the code I'm using

 

$fh = fopen("email.txt", "a");
fwrite($fh, $email);
fclose($fh);

 

What can I do here to have it enter a comma or a line break?


Viewing all articles
Browse latest Browse all 13200

Trending Articles