Programming Exercise I: A Simple On-Line Message Board


Absolutely no copying others' work

Due Date
Monday, October 06, 2008 in class. Turn in hard-copy PHP source code and the password for displaying the source code on-line (only one password for all interfaces and exercises).



The Objectives
Design and implement a simple on-line message board using PHP. This exercise is for students to learn how to write programs by using a dynamic, web programming language, PHP.



Requirements
The on-line message board includes the following features: Other than the above requirements, the instructor has the following requirements:

An Example
The following is an example of this exercise, which is with less than 100 lines including the HTML code.



            Password:        
    08:45:51 AM, 09/10/2008: Go Viking and beat the Colts!
    07:41:21 AM, 09/10/2008: He was fine with above-average performance against Packers, 19 carries and 103 yards.
    06:25:42 AM, 09/10/2008: What happened to Adrian Peterson? He was brilliant last year.
    04:22:13 AM, 09/10/2008: They should keep Brooks Bollinger.
    10:32:43 PM, 09/09/2008: He needs time to learn the system.
    08:15:56 PM, 09/09/2008: Tarvaris Jackson sucks.
    06:08:31 PM, 09/09/2008: Viking was beaten by Packers, 19-24.



Possible PHP Instructions Used
The W3Schools provides enough materials for you to implement this exercise. The following instructions may be used in this exercise:

No. Instruction Description
1 copy( file, to_file ) Copies a file.
2 date( format, timestamp ) Formats a local time/date.
3 echo( string ) Outputs one or more strings.
4 exit( string ) Outputs a message and terminates the current script.
5 fclose( file ) Closes an open file.
6 feof( file ) Tests for end-of-file on an open file.
7 fgets( file, length ) Returns a line from an open file.
8 fopen( filename, mode, include_path, context ) Opens a file or URL.
9 fputs(file, string, length ) Writes to an open file.
10 header( string ) Sends a raw HTTP header.
11 if ... else if statement
12 while( condition ) while statement



Evaluation
The following features will be considered when grading:
  1. This exercise will not be graded if the system entry interface can not be found at http://people.cs.und.edu/~userid/532/1/, and redirection (http-equiv="refresh") to the pages not hosted by http://people.cs.und.edu/~userid/ is prohibited.
  2. Before submitting the exercise, test it comprehensively. Absolutely no extra points will be granted after grading.
  3. The exercise must meet the requirements. However, exercises with functions exceeding the requirements will not receive extra credits.
  4. User-friendliness will be heavily considered.
  5. From the source code submitted, the programs will be examined.
  6. Each function will be tested extensively.
  7. Firefox 3.0 browser will be used to grade exercises. Note that Internet Explorer and Firefox are not compatible. That is your exercises may work on the IE but not Firefox.
  8. The hard-copy exercises will be kept until the end of this semester. They will be used to check against others' exercises. The instructor will inform you the exercise evaluations by emails after grading.