Exporting PHP form variables submited to Excel !!

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
sree78
Forum Commoner
Posts: 39
Joined: Tue May 20, 2003 11:38 am

Exporting PHP form variables submited to Excel !!

Post 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:
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

Post 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.
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post 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!!!
Post Reply