The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 3 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
CSC2406 Assignment Two
Due: Midnight 21 October AEST, 2015
Main Menu
· StudyDesk
· Resource Home
· Introduction
· Contact
· Study Book
· Lectures
· Practicals
· Assignments
· Resources
InAssignment One, you set up the basic design of the site, now you must expand the functionality of the site by adding PHP scripts.
Design
All new pages created for this assignment must conform to the design criterion you established forAssignment One.
All the pages you created in Assignment One should also be present in Assignment Two not just the new pages or modified pages.
Required Tasks and Elements
Assignment 1 Concepts
Marks will be deducted for failure to adhere to the concepts already marked in Assignment One. E.g.,
·Pay attention to your PHP coding style, e.g., your code should:
·Pay attention to the coding style of any new, modified or “PHP generated” XHTML or CSS files (as detailed in Assignment One).
·All new pages created for this assignment, and that includes dynamic pages created by PHP scripts must be in the same design style as all the pages inAssignment One
·This assignment must work on a Debian GNU/Linux machine running Firefox or a Firefox clone.
·Your PHP scripts must work using the supplied version of PHP—the supplied version of PHP does not have any extra modules compiled in—it is the vanilla PHP with the calendar module only.
·All URLs must work and be relative.
·Use CSS not XHTML attributes for presentation and style.
·All pages produced should be valid XHTML.
Conference Registration Page
Modify your Assignment One to add a new section: a registration section that allows a person to register for the conference.
·Create a directory called registration. All files for registration should be placed in this directory.
·Create a static XHTML page for conference registration and place the page in the registration directory.
·Add appropriate links to this page on your site.
·The registration page is a form that asks the participant for his or her registration details. Information required for conference registration will be:
·Use the appropriate XHTML INPUT types. The TEXT input type is not the most appropriate type in all cases.
·The POST method should be used to send the data to the script that will process the data.
·Input error checking must be done by the script. (But do not worry about validating the Credit Card number— to do that properly you would have to calculate the checksum using the Luhn Algorithm)
·One script will be written that will take the information from the page and append it to a CSV (Comma Separated Values — seethe note at the end) text file. One registered participant per line. The text file and the script should reside in the registration directory with the Forms page.
·The payment data file should be password protected from download. The username/password pair that should be used to protect the file should be `payments/1234'. For this assignment place the password file in the registration directory. This file should also be protected from accidental or malicious download by anyone by the appropriate configuration directives.
·If the registration information is accepted a polite message should be returned to the client telling them they have successfully registered.
·If the registration is not accepted an informative error message must be supplied explaining why it has not been accepted.
Paper abstract submission and listing page.
A page to list all the papers to be presented or submit a title and abstract of a paper to be presented.
·Create a directory called papers. All files for this section are to be placed in this directory.
·Create one PHP script to dynamically display papers or accept papers.
·Add appropriate links to this script on your site.
·Everything following is to be dynamically created by one PHP script.
Script details
·Without input the script should display a default page that offers two choices:
·Submission Option on the default page:
§ A field to enter the names of all of the authors.
§ A field to enter the name of the principal author. This is the person who will be presenting the paper at the conference. The principal author's name should be one of the names in the first field.
§ Field to enter the contact email address of the principal author.
§ Field to enter the title of the paper.
§ A text-area to enter the abstract of the paper.
§ The POST method should be used to send the data to the script.
Use the email address of the principal author to check if the principal author exists in the registration file.
·List Option on the default submission page:
Documentation
·Discuss the purpose of the PHP procedures that you have written.
·Include links in your site-map documentation to all (non-XHTML) source code files, e.g., PHP, CSS.
Note:
Error Checking
·Your scripts should check all input for validity.
·List your checks in the site-map documentation.
Marking Scheme
|
New sections conform to site's overall design |
10 |
|
Conference Registration Page |
10 |
|
Conference Registration Script |
20 |
|
Paper Script—Paper submission |
20 |
|
Paper Script—Registration validation |
10 |
|
Paper Script—Listing of submitted papers |
10 |
|
Paper Script—Display selected abstract |
10 |
|
Documentation |
10 |
|
Total |
100 |
Notes:
·CGI scripts are to be written in PHP. No other language will be accepted— as learning PHP is part of the course.
·Study the example scripts supplied with the server and that can be found in the practicals.
·There are many repeated tasks. Try and use functions wherever possible so that coding can be minimised.
·CSV or “Comma Separated Values” files are an application independent way of organising data for spreadsheets. See the PHP functionsfgetcsv(),fputcsv() andstr_getcsv().
·The following function is an example of a simple way to create a unique filename in a directory
· #
· # usage
· # $filename = uniquefn("abstract","ab");
· # will return filenames of the form:
· # ab/abstract001
· # ab/abstract002
· # ...
· #
· function uniquefn($prefix="tmpfile", $dir=".")
· {
· $max_files = 100;
·
· if( ! is_dir($dir) ) {
· return NULL;
· }
·
· $count = 1;
· do {
·
· $filename = sprintf("%s/%s_%03u","$dir","$prefix",$count);
· $count++;
· if( $count > $max_files ) {
· return NULL;
· }
· } while( file_exists("$filename") );
·
· return $filename;
· }
·
·Do Not use global server configuration directives as the directives will Not be submitted with the assignment. Directory configuration files should be used in the directories that require them.
·Some of the server file configuration directives in directive configuration files must be absolute. For example, the path to a password or group file. This is the only place where absolute pathnames should ever be used.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll