Lab 5 Assignment

In order to earn credit for Lab 5, please read the following instructions and complete the questions below.  To minimize confusion, instructions and questions are in one numbered list. So when you answer the questions, number your answers according to the questions.  For instance, your first answer will be to point #3 below.  Points #1 and #2 are instructions, not questions.  I have emphasized the questions to be answered in bold.

  1. The zip file Lab5-assignment-deleteDepartment is an extension of the application presented in Lab 5.  Unzip the folder into your Lab5 (or Lab5-student) folder.
  2. The folder contains 4 files.  With your localhost server, load the index.php file of this application.
  3. What is different about the displayed information on the page than in the Lab 5 example shown in class?
  4. Add a new department.  Name it MyNewDept.  You may want to use one of the existing department manager social security numbers, because the foreign key constraint requires that you use an existing ssn.  Take a screen shot of the page listing the departments with the new department, and include it for point #4.
  5. Now delete the new department.  Take a screen shot of the page listing the departments, and include it for point #5.
  6. Open the file index.php.  Write the line numbers of the code that has been added to handle the deleting of a department.  
  7. The very first time that this file is loaded, are there any conditions of any IF statements that are TRUE?  If so, what is the line number of that IF statement?  If not, simply write "no".
  8. The very first time that the file is loaded, what is the first "try--catch" block that is executed?  List the line number of the "try". 
  9. What does this try--catch block attempt to do?
  10. Does this try--catch block display anything on the screen?
  11. What line in this file (indirectly) causes the departments to be displayed?
  12. What file actually displays the departments?
  13. Open departmentFields.html.php
  14. Look at line 16.  I thought this application was about deleting a department.  Why is there a link to add a department?
  15. I know that we covered this in the AddDepartment application, but why does that link start with a "?"  Shouldn't it have a URL?  What page is loaded if this link is clicked by the user? Write the complete URL, beginning with "localhost".  (Hint:  this will be a "postback".  If you are not sure of this answer, load the page, click on "add department" and see what the url is!!)
  16. Line 27:  there is a "get" and a "post" in the same form!  What is the "get" (copy the exact text that means "this is a get")  and what information does that pass when the form is submitted?
  17. What is the "post" (copy the exact text that means "this is a post"), and what information does that pass when the form is submitted?  List the variable(s) name(s) and value(s).
  18. What page is loaded (or reloaded) when the form is submitted?
  19. Why that page?  I thought this was a postback.  Why isn't departmentFields.html.php reloaded?