Jump to content

Simple form that appends to a text file


Alice

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/275090-simple-form-that-appends-to-a-text-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.