Jump to content

Data Collection from an HTML form into Excel?


time
 Share

Recommended Posts

I've only coded a few html pages in my life and I'm trying to figure out if I'm way over my head here. I'm trying to create an online ordering page that has 3 user input fields and a drop down box that I can collect data from. I would like to avoid having my email overloaded and copying and pasting the information by hand into excel so... is there a way to have the information from the form automatically placed into an excel file? Or more precisely, is there a relatively simple way to do this? I already have the form coded, just need the submission part figured out. I'm doing this on a MacBook Pro and coding in plain old TextEdit, no fancy programs. If there is a way, I'm good at following directions so any help is greatly appreciated.Thanks!

Link to comment
Share on other sites

To store information into databases (which I think is preferrable to an excel file because you can read the data however you like) you'll need to learn PHP and MySQL. If you want to read the data in excel I think you can export database data in csv files or some format like that.There's nothing in a website that needs fancy programs to be made. Everything can be done with notepad.Check out W3Schools' PHP tutorial

Link to comment
Share on other sites

If you don't need fancy excel things like formulas and formatting, you can just write the data as CSV using PHP's file functions.However, if you need to automatically manipulate that data later on, databases would be a better idea.

Link to comment
Share on other sites

If you don't need fancy excel things like formulas and formatting, you can just write the data as CSV using PHP's file functions.However, if you need to automatically manipulate that data later on, databases would be a better idea.
The only thing I may have to do to the data laster is sort it. Otherwise, no formulas or formatting. What's CSV?Thanks
Link to comment
Share on other sites

It's a data saving format: Comma Separated Values.I think it's something like this:cell11,cell12,cell13;cell21,cell22,cell23;I'm not sure, I've never examined the format. Anyways, it saves database table information in a file that excel knows how to read.

Link to comment
Share on other sites

You can copy and paste an HTML table directly into Excel, it will keep all of the formatting. It might only work (or work best) when you copy from IE. If you want to automatically generate a CSV file that Excel can open then you will need to use a server-side language like PHP. PHP has this function to convert an array to a comma-separated list that can go into a CSV file:http://www.php.net/manual/en/function.fputcsv.phpThe format of a CSV file generally is that each field is separated with a comma and each line is separated with a newline character. If a field has a comma in the value then you can wrap the field value with quotes, if the field has a quote in the value then you can escape the quote with a backslash. The PHP function will do all of that for you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...