Page 1 of 1

Please help with CSV files

Posted: Wed Feb 10, 2010 4:21 am
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

Re: Please help with CSV files

Posted: Wed Feb 10, 2010 12:33 pm
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.