Link to home
Start Free TrialLog in
Avatar of rutlandict
rutlandictFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Exporting data from PHP form to Excel/CSV file.

Hello,

I would like to know how do export php form data (Online Registration Details) to Excel or csv file. For eg: it should be saved in the excel file automatically, each time any new user registers and fills up the php form. All the information of users would be in this excel file. As of now, we get an email with the new registrations. But apart from getting emails, all details should also be saved in this excel file automatically.
Please let me know some quick solution or code as its needed urgently for my project.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Kalpan
Kalpan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You should change the design pattern for this application.  Instead of saving data in an EXCEL file, you should save the online registration details in a data base.  You can easily get information from the data base to create a CSV file (almost universally associated with Excel) and you can email CSV files with ease.

PHP has functions like fgetcsv() and fputcsv() that facilitate using the CSV files.  Most SQL data bases have export functions that can give you a CSV, too.

The advantages of using a data base instead of an Excel file are too numerous to mention, but please trust me - that is the way to go.  An experienced developer can get you up and running with something like this in less than a day.

best of luck with your project, ~Ray