Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CREATING A Content Management System In this assignment, you will use your PHP and MySQL skills to create a social media site. Authorized users can

CREATING A Content Management System

In this assignment, you will use your PHP and MySQL skills to create a social media site.

Authorized users can post, and can comment on other posts.

You have already created and populated your Database in another assignment.

Here are some scripts that you will need to write (you may write more, depending upon how you implement this).

USE FUNCTIONS WHENEVER POSSIBLE. In addition, validate all input data and sanitize all data.

index.php

This is the front page of the blog. It displays the five most recent blog postings, most recent first!

This is done the same way (prepared queries) as the Databases with PHP lab.

Each post includes the authors name and date of creation.

At the bottom of the page, there are two links one for previous 5 postings, and one for next 5 posts. At the bottom of each post, there are two links, one to add a comment to this post, and one to read comments to this post. These two links have to get parameters showing which post it is, and are two PHP pages that are due at a later date. At the bottom of the page (or in a menu, however, you implement this) there are also options to login or Add a Post or logout.

login.php

Validates the user, starts the session. This page is the one we discussed in class. It has a form that allows the user to put in a username and password. It checks to see if the user and password exist in the Users table. If yes, it sets a $_SESSION variable to indicate that this is a valid user. When the user hits submit index.php loads.

addBlogPosting.php

Only authorized users may add posts. This script checks that the user is valid (has logged in) and allows the user to fill in a form that adds a blog post. When the user hits submit index.php loads.

addComment.php

Only authorized users may add comments. This script validates the user and allows the user to fill in a form that adds a comment. When the user submits a comment the page that shows all comments on that particular post loads.

viewComment.php

Allows all users to view comments on whichever post is chosen.

logout.php

Closes the session for logout.

For index .php have only the first 200 words show for a posting with a link that allows for the full post to show.

2. Change the comment link on the bottom of the post to say how many comments there are on that particular post (example: link could say See 5 comments if there are five comments on that post)

3. Allow users to register! (So far only the four users that you have can logon) See Chapter 27 in your book. This is simply another form with registration, that adds a user to the database of users if the user is not already registered. [You can even add a CAPTCHA to this form. Use the web to find open source code that can do this.]

4. Allow users to change/delete their own posts and comments. Be careful! What happens to comments on a post, if the post itself is deleted? In addition, allow the system administrator (one particular user!) to change/delete any comment or post.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions