PDA

View Full Version : form export to excel or mysql


danieljohns
06-27-2008, 08:40 AM
hi everyone,

i need help in setting up my website. i will be using a linux based server with the following specs:
Apache: 2.0
PHP: 5.2
CGI: Perl: 5.8.5
Curl: 7.12
MySQL: 5.0
Python: 2.3.4


i am looking to incorporate a form into my website to request info like: name, address, phone number, etc.

there will be hundreds of people entering data into the website, and what i want to do is to take this form data and somehow export this to an excel spreadsheet (or equivalent database) with all the names in one column (in alphabetical order).....and all the addresses, phone numbers, etc in the other columns NEXT TO the corresponding name.

this excel sheet would need to be produced on a daily basis, and people would be entering new data over a period of a couple of months

i would appreciate any help in achieving the above. i have used Dreamweaver cs3 to already make the website and form itself. I need help in getting the data from the form into the database, and the processing of the data. Thanks in advance

jryoung
07-01-2008, 04:39 PM
Unless you have Perl or PHP experience it would be advisable to find a form that is already set up that you could incorporate into your site.

nkrgupta
07-02-2008, 12:45 PM
In order to get the form data processed by Perl, you should use the CGI (http://search.cpan.org/%7Elds/CGI.pm-3.38/CGI.pm) module. The you must use the DBI (http://search.cpan.org/%7Etimb/DBI-1.605/DBI.pm) module to send the data to the MySQL db.

As far as making excel reports out of a DB table are concerned, the best way that comes to my mind is read the DB, create a csv file - either by simply creating a comma separated file containing your values, or by using a module such as Text::CSV_XS (http://search.cpan.org/%7Ehmbrand/Text-CSV_XS-0.52/CSV_XS.pm). Then you can import the csv file in any spreadsheet software and export it in excel format, if you require. This I say because creating excel directly from data would require use of modules such as Spreadsheet::WriteExcel (http://search.cpan.org/%7Ejmcnamara/Spreadsheet-WriteExcel-2.21/lib/Spreadsheet/WriteExcel.pm) which could be a bit tricky.

Now the main question - how much of experience do you have in Perl, if any, and have you ever worked with any of the modules before?

HTH
Naveen