HomePHP Page 2 - Building A Quick-And-Dirty PHP/MySQL Publishing System
A Little Slug-gish - PHP
Looking to quickly add a dynamic news page to your corporate orpersonal Web site? This article shows you how, combining PHP's rapidapplication development capabilities with a MySQL database to create aprimitive news publishing system and administration module in just underfour hours.
The first task in any development effort is to figure out the customer's requirements. I accomplished this via a phone call to the person most likely to be using the application, the customer's Media/PR department head. She told me exactly what she wanted...and it boiled down to this:
1. An additional couple of pages added to the existing site to list the latest published news and press releases.
2. An administration interface so that individual editors within the PR department could easily publish new press releases to the Web site (her exact words were, "give me something simple, please! I don't have time for anything complicated!").
Since I was already thinking of using a database to store the press releases, I thought this would be a good time to get a little information to help me design this database. So I also asked her to define the attributes of a press release, so that I could build an appropriate administration module, and the functions available through this module.
After much thought and consultation, we concluded that a press release could be broken down into:
- a title (which she called a "slug", much to my amusement);
- a main body containing the text of the press release or news item;
- an information section containing the publication date and the name of the person to be contacted for further information on that particular release.
As to the functions available in the administration module, she said that all she was interested in at the moment was:
- the ability to add new press releases to the site (obviously!);
- the ability to edit existing releases, in order to make corrections or update them with new information;
- the ability to delete older, out-of-date releases and news items.
On the basis of this conversation, I was able to define the amount of work involved quite clearly. So I sent out some email to her and to my boss to get their approval and acceptance of the requirements document, and decided to start work immediately.