Question: Please use correct coding Problem Review (current Rewrite the file handling code to use Exceptions correctly rather than using or die) All of the following
Problem Review (current Rewrite the file handling code to use Exceptions correctly rather than using "or die)" All of the following demonstrations MUST be active at all times on lamp server, and the TA should be able to see that all of the specified features are working by entering data. Use separate forms in a single index.html file, with possibly different script files linked to each "action" for each form. Ask questions if you are not clear At least one "writing" example should succeed [-2 points if this is not the case] and at least one writing example should throw an exception should be displayed back to the user. [-2 points if this is not the case] At least one "reading" example should succeed [-2 points if this is not the case] and at least one reading example should throw an exception should be displayed back to the user. [-2 points if this is not the case] . . . . 1. Your PHP code must also demonstrate that you can successfully "append" to a file that may or may not exists. [2 point) 2. Your PHP code must demonstrate that you can successfullywrite" to a filebutitthrowson Hint: Look at all the modes of opening a file. [4 points] 3. Your code must demonstrate that you can successfully read a file that already exists (and print its contents) [2 point] 4. Your code must demonstrate that when you try to read a file that does not exist, an exception is thrown. [2 point]. BONUS: Write a PHP class called MyFiles that contains functions read), appendO. overwrite0 and write) to do all of the above by using parameters and handles all possible exceptions. [4 points]. If you do this, you do not have to do steps 1 through 4 and you will be graded out of 14 points. 5. EO
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
