I need a very basic PHP form that asks one question (seeking an integer response) and updates a CSV file. The form doesn't have to be pretty (no CSS or styling is required), and basic HTML 4/ XHTML 1.0 transitional is all that's required.
This form is used to ask my employees for certain metrics they have to provide me each month. The CSVs generated get fed automatically into a larger application/ workflow that has already been developed.
The PHP script must be able to keep and maintain a history of data entered within the CSV file itself, and maintain a specific header that's required for the rest of the application.
PHP Form asks one question: "What is your value?"
Based on the response (integer), a CSV is updated that inserts this value.
The path for the CSV should be definable. If it doesn't exist, the script should create it upon being called for the first time.
The question should be definable.
The CSV contains two fields:
value (INT), date (MMM-YY)
The CSV also contains a header on row #1. NO DELIMITER. Example:
So to recap, a completed CSV would look something like the following:
Notice that the previous 12 months is maintained within the CSV in a LIFO fashion. The script I am asking you to develop must discard the oldest record from the CSV.
Also - the date (field #2) should be auto-populated and can use PHP's date(); function based on the month & year when the script is called.
No authentication and access control is needed or required as that's already baked-in to the rest of the website.