Please help with CSV files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
laetus
Forum Newbie
Posts: 1
Joined: Wed Feb 10, 2010 4:13 am

Please help with CSV files

Post by laetus »

Hi Everyone,

Thanks for taking the time to read my post.

I am very new to the world of PHP and am completely and utterly stuck.

I am designing a newsletter site and have a form with checkboxes.

The form isnt built yet but I wont have a problem with doing that.

The issue I have is I would like seperate CSV files for each of the checkboxes.

I would like the users name, email and contact number to be automatically inserted into the relevant CSV files for later download but for ease of use I would like them to be seperated.

I have looked at things like PHP Form Generator and searched high and low on search engines.

I understand all info from a form can be downloaded to 1 CSV but I would like to know if what i'm trying to do is possible?

Something like if option 1 is yes send name, number and email here, option 2 send there etc

Many thanks in advance.

James
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Please help with CSV files

Post by Christopher »

Appending data to multiple CSV files is no different than appending to one file. You just need some logic to determine which file(s) to write to. You may want to think about writing all the form data to a database, and then generating the specific CSV files from data you query from the database. That way you can do specific form fields and also limit to data in a specific date range, etc.
(#10850)
Post Reply