Project 2: PHP and MySQL
Objective
Create a course enrolment system.
Preparation
- Create a MySQL table to store course name, course code, and maximum enrolment. Each course must have a unique name and a unique course code.
- Create a MySQL table to store student name and student number. Each student must have a unique student number. In real world environments, two or more students may have the same name. The application must be tested to handle that case.
- Create any other MySQL table that may be needed to store data, for example, a table to list all students enrolled in each course. In a real world application suite, the application that enrols students may not have authorization to modify the student and course tables. Separating data by functionality simplifies applications and maintains data integrity.
Operation
- A visitor’s initial access to the application will be through its main page. The main page will be named index.php.
- The main page will display a single form composed of a selection field and two text fields.
- The visitor will select a course from the selection field.
- The visitor will enter a student name in one text field and a student number in one text field.
- The visitor must not be shown a list of student names or student numbers.
- If the student information does not match an existing student record, the visitor must not be told which part of the student information does not match.
- If the course selected does not match an existing course record or if the student name and student number entered do not match an existing student record or if the course selected has reached maximum enrolment or if the student has enrolled in the course already, the student cannot be enrolled into the course.
- Otherwise, the application must enroll the student into the course.
- The visitor must be informed of the results of the enrolment attempt and allowed to select from the course list again.
The objective of the project is to demonstrate PHP and MySQL skills. To maintain focus on the server side objective, the client side must not include any coding except for HTML.
Make no assumptions about which client platform will be used to test and grade the project. The application must work equally well with any web browser on any platform. See Any Browser Campaign’s Accessible Design Guide and search the W3C web site for information on accessibility standards. For example, the W3C specification for Tables in HTML documents makes recommendations for designing tables that can be rendered by non-visual user agents.
Grading Criteria
Grading will be based on the material that has been installed on the hosting server by the end of the day on the project due date. Grading will based on a visitor’s ability to access index.php on the day after the due date, select courses and enter student information for enrolment.
Testing will include:
- enrolling in courses that do not exist
- enrolling students that do not exist
- enrolling students who have identical names
- enrolling a student in courses in which the student is enrolled already
- enrolling students in courses that have reached maximum enrolment
- verification that the PHP scripts contain no data
Grading will include a review of the submitted files and MySQL tables. Scripts must not contain data. Scripts should be commented well to indicate the intent of each section of code. If an operation fails, comments that indicate a clear understanding of how the operation should have been implemented and how it meets the requirements of the project may help the grade. Since no separate documentation is required for the project, the internal documentation (the comments within the scripts) will serve as the full documentation. Any information that would be included in external documentation should appear in comments in the appropriate parts of the scripts.
Grading will include examination and manual modification of MySQL tables to verify proper generation of HTML forms and to test special cases such as two or more students with identical names.
Project Submission
The project will be submitted in two parts.
Part A consists of:
- a MySQL table to store course name, course code, and maximum enrolment
- a PHP script that reads the course table and uses the course table to generate an HTML form that allows a visitor to select a course
Part A must be submitted before the early submission deadline. The early submission deadline is seven days before the project due date.
Part B consists of the entire project and must be submitted by the end of the project due date.
All MySQL tables must be created via PHP.
The project will be submitted by installing on a LAMP server. The purpose of submitting the project by installing on a live production system is to provide experience in a realistic hosting environment. Since the hosting environment may have differences from the development environment, applications must be tested in the development environment and then re-tested fully on the hosting server. Installing and testing on the live server may take several days. Send a request for access to Michael.Morris@durhamcollege.ca at least two weeks before the due date. No submissions will be allowed after the submission deadline.
A sponsor is providing the hosting service at no cost to the taxpayers of Ontario. The service is provided only for the purpose of the project. Any other use will result in a failing grade.
© Durham College. All rights reserved.