JavaScript: Saving certain data to a csv

mikead

New Member
I understand that JavaScript isn't really made to open and save files. The best method I've seen to get this to work is to use a form and then POST all the information I need to a PHP file that can than save the information I want to a file.I plan on producing this kind of data and storing it to a csv:Name,Low,High,NumberUsing inputboxes and javascript. I have decided that I will start off like this (____ is an inputbox)\[code\]Name: ______________ Start: 0 End: _____ Wage ______ [add button]\[/code\]When the person clicks add, it will then store the data to a variable. How should I do this the best? Assuming the person fills in this information:\[code\]Name: Brian Start: 0 End: 100 Wage 200 [add button]\[/code\]Should I do something like $Array['Brian'][0,100,200]?And then I can somehow loop through the array in PHP when its sent via POST?Keep in mind when the person clicks Add, another option appears using previous data such as my example of Brian,0,100,200\[code\]Name: Brian Start: 100 End: ______ Wage: ______ [add button]\[/code\]The idea being that no gaps between low and high can be created. You can't end at 100 and start at 200, the next is always the start.Edit:Just to give some background, what I am storing is actually hourly wage for people. Brian,0,20,20 actually sets that for hours between 0 and 20; brian will make $20 an hour.What are "Start", "End" and "Wage" signifying?
Start of the hour range, End of the hour range, and the hourly wage.Do you need to store their data permanently?
It will need to be stored to a CSV file, which gets intercepted by the client and covertes it into a SQLite memory database for processingWill there be more than one entry for "Brian" within a storage period?
Yes, as many entries as you wish. There also HAS to have a name which 'Default' is set... This will be the case where if the employee doesn't have special wages, they get the default employee wages and overtime something like:
Default,0,40,15
Default,40,1000,20
 
Back
Top