Hi James, I believe this will help you achieve what you want
PHP form inserts data into CSV file
Hi Folks,
I really need some help if possible.
I am creating a form with multiple check boxes which is straight forward enough but im stuck on the coding side of things.
I would like different CSV files that relate to each checkbox where if the check box is ticked the clients email address will automatically be stored in each corresponding file. (The clients email address could end up in more than one file)
I believe i'll need a webhost with PHP enabled which isnt an issue and I think I need to upload the CSV files to the server but I am stuck on the coding to tie the files to the fields.
I have tried using things like PHP form generator but I cant get it to do exactly what I want.
Any help/advice would be greatly appreciated.
Many thanks in advance.
James
Hi James, I believe this will help you achieve what you want
PHP form inserts data into CSV file
The trouble with the rat race is that even if you win you're still a rat.
Time passes. Listen. Time passes. Dylan Thomas
Ebay Alerts to your inbox
Thanks for taking the time to reply to my post.
I have already read that article and it didnt help with what I wanted the form to do.
I am designing a newsletter site and have a form with checkboxes.
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.
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
James, all you need to do is use the code on that example, then run some php if loops based on the checkbox value, eg.
if ($checkbox1value=='Yes')
{
code to write to csv1
}
if ($checkbox2value=='Yes')
{
code to write to csv2
}
..............
if ($checkbox10value=='Yes')
{
code to write to csv10
}
The trouble with the rat race is that even if you win you're still a rat.
Time passes. Listen. Time passes. Dylan Thomas
Ebay Alerts to your inbox
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks