Assignment: Handlebars

In this assignment we will merge our add.php and edit.php into a single form.php which is capable of adding a new entry or editing an existing entry. All of the form rendering will be done with the the Handlebars JavaScript library.

In the sample code, some off the files have been comverted to completely use in-browser rendering for dynamic data, other files use a in-server MVC approach similar to previous assignments, and others are hybrid:

You can play with a sample implementation of the code at:

You can download nearly complete implementation of this assignment at:
The only part that is missing its implementation of profile.php. Without a working profile.php the application's add functionality will work but the editing and view functionality will not work.

To complete the application you must add the profile.php. The profile.php will take a profile_id as a parameter, query the database tables, and return JSON that looks as follows:


        "email":"[email protected]",
        "headline":"Having a nice day",
        "summary":"A short summary"
            "description":"Still being alive"
            "name":"University of Cambridge"

What To Hand In

As a reminder, your code must meet all the specifications (including the general specifications) above. Just having good screen shots is not enough - we will look at your code to see if you made coding errors. For this assignment you will hand in:

  1. A screen shot (including the URL) of your form.php showing editing an existing entry showing the retrieval of the JSON to populate the form.
  2. A screen shot (including the URL) of your profile.php showing the retrieved JSON.
  3. Source code of profile.php

General Specifications

Note: These are unchanged from the previous assignments. Here are some general specifications for this assignment:

Provided by:

Copyright Creative Commons Attribution 3.0 - Charles R. Severance