JavaScript: Saving certain data to a csv
<p>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.</p>

<p>I plan on producing this kind of data and storing it to a csv:</p>

<p>Name,Low,High,Number</p>

<p>Using inputboxes and javascript. I have decided that I will start off like this (<strong><em>_</em>__<em>_</em></strong> is an inputbox)</p>

<pre><code>Name: ______________    Start: 0      End: _____  Wage ______  [add button]
</code></pre>

<p>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:</p>

<pre><code>Name: Brian             Start: 0      End: 100    Wage 200  [add button]
</code></pre>

<p>Should I do something like $Array['Brian'][0,100,200]?</p>

<p>And then I can somehow loop through the array in PHP when its sent via POST?</p>

<hr>

<p>Keep in mind when the person clicks Add, another option appears using previous data such as my example of Brian,0,100,200</p>

<pre><code>Name: Brian           Start: 100       End: ______   Wage: ______   [add button]
</code></pre>

<p>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.</p>

<p>Edit:</p>

<p>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.</p>

<p><em>What are "Start", "End" and "Wage" signifying? <br></em>
Start of the hour range, End of the hour range, and the hourly wage.</p>

<p><em>Do you need to store their data permanently? <br></em>
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 processing</p>

<p><em>Will there be more than one entry for "Brian" within a storage period?</em> <br>
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:<br>
Default,0,40,15<br>
Default,40,1000,20</p>
