Project assignment 2: Displaying a php array of posts and comments

Due Thursday, March 11 at 11:59pm

Task 1: displaying blog posts

You are given a file post_data.php that you can include in your php code. The file defines an array $post_array, where each element represents a blog post. A blog post is in turn an array that consists of:

The file should be included in your program using "require" or "require_once".

Your task is to write a php program that creates a page with these entries. The page should be displayed using the CSS files designed in task 1. When you are generating HTML in your php code, make sure to insert appropriate HTML tags (for instance, em for the user name) and appropriate CSS classes if needed.

Task 2: displaying comments and user information

Here is the array of comments for one the post: comment_data.php. For this task you need to include both the post_data.php and the comment_data.php files into your php file so that you can get the text of the post as well. The page must display the post (that's the post with the index 10 in the post_data array) and all the comments.

You also need a page that displays user information: the login name and the display name. Since there isn't much test data, you can write the test data for this part on your own.

For a group of three

Include one extra feature with this assignment. Here are some suggestions:

How to submit your assignment

To submit the assignment, just send me (by e-mail) URLs of all files, including your CSS files. Please CC your project partner.
Your files must have comments indicating who worked on what. If you worked together, put a note about it in a comment.
Please do not modify your files after submission: you should continue your project with a separate copy of all files.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.