Specification for basic databaseless content management system.
The purpose of this PHP application will be to allow unskilled people to log in to a page in their site, and edit certain blocks of text on certain pages.
There will be no external database used, and no external setup or configuration file.
The application will read through a specific HTML file specified in a variable at the top of the program, and parse that file to construct an editing page with input text boxes and a submit button.
The user will then change any text they wish to, click the submit button, and the program will re-write the HTML file, replacing any editable sections with the user's input.
HTML comments will allow inline storing of information in the HTML page, and definition of the sections that can be edited. Initially there will be only two of these special 'tags':
1. The title of the page
2. The sections to be edited
These will work like this:
1. At the top of the page, there will be an HTML comment that looks like this:
This will store the page title, which should be displayed to the user at the top of the editing page.
2. The sections of the HTML to be edited will be defined like this:
This text can be edited by the user in the application
This will result in a text box populated with the uncommented text shown. The user may change that text, and it will be rewritten to the same section.
There will be an unlimited number of possible sections, but they must all have distinct and unique NAMEs.
The script will have the following flow:
1. Read the HTML file and produce a basic form that shows:
* The page title from VAR_PAGETITLE
* An input box for each VAR_SECTION_EDIT populated with that section's current text, and with a label to the side of it that shows that section's name
* A submit button that submits the form to PHP_SELF
2. After submit button has been clicked, replace all sections with the user's input. All 'special' HTML comment tags should be left intact.
The application should be able to process HTML tags being entered in the page.
Complete and fully-functional working program(s) in PHP script form. Must be very well documented. Non object oriented code must be clearly separated into specific functions.
I am looking for very well commented PHP code, from someone with at least 1 yr PHP experience.
I strongly prefer object oriented PHP code.
This code should run on PHP4.x, on Linux, and I have no specific code ownership requirements.
The HTML file will be read by opening a local file (initially in the same directory as the script is fine).
I would like to have this completed as soon as possible. I'm available by email from 8:30am to 11pm EST. Code must be complete by Sunday 13th 6PM EST.