Page 1 of 1

Exporting PHP form variables submited to Excel !!

Posted: Wed Aug 20, 2003 2:46 pm
by sree78
Hi,

I am wondering if is it possible for a form created in php to store the variables submitted in a text file? I have done many forms in PHP which gets directed to the specific email account. My new project requires the data's to be stored in a excel spreadsheet.
I have done this before with a software called persues, it sends a form variables which is stored in a text file to your email and you can import the data to spreadsheet from there. Any help and ideas are highly appreciated.

Thank You guys :idea:

Posted: Wed Aug 20, 2003 7:29 pm
by tsg
First let me say, I DON'T KNOW .. But, if you take a spread sheet and save as a CSV file, then open it up in notepad, you will notice a format. Something like:

2,"ITEM","DESCRIPTION",34,

the comma sperates the columns, some stuff in "".

There are different formats .. some use a ; instead of a , to seperate.

In my thinking, you could save the data to a text file in the format mentioned above, and give it a .csv extention, then can be opened up in a spreadsheet.

Just my thoughts.

Posted: Thu Aug 21, 2003 2:20 pm
by m3rajk
i agree with tsg. since excel actually uses csvs as a way to store info without markup so it can be easily transported to other spreadsheet programs, that is the best thing to do. store it as a csv. i believe excel uses, to seperate, meaning you might get something funky if there's a , in youre input text

two functions you should look at: Implode and explode

not only can you save it TO a csv, you can import information FROM a csv!!!