Applications with low volume and short life span can be easily handled with a simple file application. The file created can be read with any text editor. You will want to be careful that all data is separated, and that each data record is on a separate line in the text file.
Reading the file and showing the data on a response page requires that you break apart or ‘explode’ each record in the file.
You will create a Telephone Directory Application to save entries into a single text file. Your HTML form will collect the following data items:
1. Last Name
2. First Name
3. Street Address
7. Area code
8. Phone Number
Your PHP program will take the data submitted by the form, using string functions assemble one record to be written to the file for each Telephone Directory entry that is submitted.
The data will be written in a comma delimited line of information terminated by a new line character and will be appended to the telephone data file. When multiple entries have been made to the form, the file should contain all the stored items on separate lines.
Be sure to ‘close’ the file when the data has been written.
In a new program you will open the file to ‘read the data’ and list all the items currently in the file. Your PHP program will present the data in a format that is easily readable, not in the manner it was ‘stored’. Provide a link or button to ‘run’ this program on the HTML form page.
When you have completed this application, you will need to send the Folder that contains the HTML, PHP and Telephone Data Files. You should zip the folder prior to uploading the file to the Drop Box.