CS 594/494 PHP EXERCISE No. 1

Due on March 14, Fri at 5 pm

This is a CS594/494 group exercise in PHP scripting for future use in the course project. Only one submission from any group is required on/before the due date (Friday, March 14 at 5:00pm). The submission should include the names/usernames of all the members of the group and a brief evaluation of the work performed by each member of the group. This evaluation can be included in the submission e-mail. Remember the project in this class is a team effort!

You will submit two php scripts for this lab: format.php that accepts user data in a webform and generates an XML datafile, display.php that creates an HTML-formatted webpage corresponding to any XML datafile you created with format.php. Both of these php scripts should be emailed to the TA by the deadline specified above. Be sure to install error checking into format.php. The specifications for the fields must be enforced. For example, if the user does not supply 75 words (including stop words), the user must be prompted to complete their answer till the requirement is met. Deductions will be made for any/all specifications that are not met.

Work through the PHP Tutorial listed on the Course Project webpage. Make sure you are comfortable with the XML and PHP examples discussed in class (and linked on the Project webpage).

In this lab you will write php code to

  1. create a form through which a prospective job seeker can store (upload) his/her resume into your (future) automated system;
  2. parse the form and create an XML-formatted datafile with the appropriate tags;
  3. create an HTML-formatted page (for display) from the XML datafile.

View the resume.xml datafile and corresponding resume.html for a sample illustration of the fields you need to define/parse/display for any resume submitted.

You should take the first and last name of the person specified in the form and name the XML file (created by format.php) accordingly. For example, lana_mironova.xml. Use the underscore character to bind the two names for the XML filename. This XML file should be created in the same working directory that the format.php file resides. Then, you must make sure your display.php can accept any XML filename as an input parameter. For example, display.php?file="lana_mironova.xml". Invoking the display.php in this way within the browser should cause the html-formatted data to be displayed.

In writing your XML datafiles be sure to include the function call

umask(0077);
in your format.php file so that the login nobody will only have read/write permissions on the file.

Also, it is best to create these files in the /scratch directory of the http server. This directory is available from all the cetus and hydra machines. These files will be kept for 2 weeks and then deleted automatically. You can, of course, make copies of these XML files for your own directories.

Here is metadata for the fields you need to use. Assume all field are left-justified unless otherwise specified (e.g., centered).

Note: Any row for Education or Experience must be complete - that is, all records must be complete. A table left blank correspond to no education and no experience.

If you have any questions e-mail Lana Mironova or come by office hours on Monday 10:00 - noon.