For this assignment you need to design and implement an online contacts directory that can be used to retrieve different types of contact information including phone number(s) and address data. This directory may prove beneficial as once it is available on the web, you can access this information from any net enabled device. In addition, as you may get new or updated information on a contact while away from your home computer, having the ability to add new contacts or update existing contacts wherever a net enabled is available may also prove beneficial. Similar applications to this are Google Contacts, iCloud Contacts, and Microsoft Office 365.

Design Requirements

You should create an online contacts directory application that saves entries to a single text file. Include standard contact directory fields in the text file such as first name, last name, email address, phone number, street address, city, state, and zip code. You will want to plan how to save this data to the file for easy retrieval. Hint: Your textbook may provide helpful insights.

As part of your application, one web page will serve as a main "directory," where you can search and retrieve records along with a document that allows you to add contacts. You should have another web page that you can use to edit contacts. All pages should allow the user to return to the main directory.

Below is an example of the main "directory" output you should have before formatting: see image.

Whether a user is searching, adding a new entry, or updating an existing contact you should verify that they have entered a value in each field. If the have not, then you should indicate this to them via server- side scripting. When an entry has been successfully saved or updated then you should tell the user. If a search, save, or update was not successful then you should indicate this to the user. You should also alert the user if the text file containing the contacts does not exist.

On the next page is an example of one of the error outputs you should have before formatting: see image.

On each entry form, the state field must be set up using a < select> drop-down list as shown in the example diagram. In addition, the update page must pre-select the state previously saved along with pre- filling all the other fields with the values previously saved.

Below is an example of the edit entry and add entry output you should have before formatting: see image.

Whenever you are writing data to the file, you should appropriately lock the file to prevent a mismatch of data being saved. If the file cannot be locked then you should alert the user to retry submitting the form in a few moments as other updates are being performed. Constants should be used for values that do not change, and variables for values that change during the course of execution. You should include Last Modified Date information on your page. This should be provided dynamically by using the built-in date()function within the getlastmod()function.

At the point of final submission, your application should be laid out in the Lab Content area of your web site. When laying out your web page, you should retain the common navigation and structural components (header and footer) of your website even though not shown in the image. This will require you to incorporate the SSI file references in this lab assignment as you did on previous the lab assignment. SSI files should not be moved but rather you should provide the path to their original file location. The common navigation and structural components should present visual continuity across all the web pages of your website and should not shift at all when going from web page to web page. In addition, while the image does not demonstrate this, you need to include a working link on each page to get back to your home page. Each page of the assignment should load into the Lab Content area only.

For the main "directory" page, you should use a file name that will automatically load when a user specifies only the folder name in the URL. The file should be uploaded to your Lab Assignment 3 directory. Your XHTML file should be well-formed and created using a strict XHTML DTD. You can create the web page using any text editor (Microsoft Notepad, RogSoft Notepad+, Adobe Homesite, etc) that is not WYSIWYG capable (Adobe Dreamweaver, Microsoft Word, etc).

You should use XHTML for the content of all pages and CSS for the stylizing and positioning of each of the pages. Using an external .css file, add formatting of your choice to make the output more aesthetically pleasing. These styles should be implemented as part of the early submission points. While you should continue to use the external CSS you created for your home page, you should not modify or update the file. Your new CSS file should not conflict or modify the layout and positioning of earlier lab assignments.

Approach

For the first submission point, create a simple XHTML page for all the pages of the online contact directory. These pages contain no PHP however some of them will have forms that submit to a separate .php script files. Create a text file with starting records that correspond to the order of the form fields for contact names, addresses, etc.

After creating the non-PHP XHTML pages, you may want to start by determining, coding, and validating the .php files using XHTML (and absent of any CSS). You can simply assign a record to an array for early functional testing. As part of this, and after the first submission point, begin to populate these arrays with the contents of the file instead. Add the ability to write to the file. Once working like the output given, you can begin adding the CSS formatting. Finally, validate all the pages and correct any ill-formed tags where necessary.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.