The Internet: Co-Evolution of Technology and Society
CPSC 156a, Fall 2003

HW2: A Glimpse at the Server Side



 

1a.  Logistics
 


1b.  Introduction

In HW1, you were introduced to the client side of HTML forms.In HW2, you will see a little bit of what happens on the server-side when a user submits an HTML form and will test your understanding of a few of the Internet-protocol concepts that were discussed in class.

Please be patient as you read through these instructions for HW2.  They are long, and there are several new technical terms introduced, but HW2 is actually a fairly easy assignment.  It will count for 10% of your overall course grade, in contrast to other HW assignments and the two in-class exams, each  of which will count for 15%.

As explained in HW1, client-side forms generally link to a server-side program called a script that allows the user to enter data.  Actually, there are often at least three important server-side programs that are run when a user enters some data by pressing a Submit button on a client-side form:  the script that the client-side form links to, the web-server system itself, and one or more application programs that process the data entered in a manner that makes sense in context; for example, if the form submitted is an order form, then one of the application programs run in this context might be an inventory system that checks whether the merchandise ordered is available.  In this HW assignment, the application program that will be run is a database-management system called MySQL;  it is explained briefly in the section 1c below.

The web-server system software that is being used in this assignment is Apache, the most popular web-server system in use today.  Anyone running a web-server needs Apache or one of the competing server systems to provide the overall framework for the server.  The web-server system basically manages all of the server-side activity in an enterprise;  in particular, it stores web pages and other data files, it stores and runs scripts, application programs (such as MySQL), and other executable files, and it provides links to other machines that store relevant data and programs.

A script is a program that facilitates client-side requests for server-side action.  In this assignment, the script is responsible for receiving raw data that are entered on the client-side, parsing these data (i.e., extracting the parts that are meaningful in context and formatting them so that they can be processed), feeding the data to the database application, generating a "transcript" of the client-server interaction and the results produced by the database application, and sending the transcript to the client so that it can be displayed for the user.  ("Transcripts" are explained in section 1d below.)

In this assignment, the script, the web-server system, and the application program are all running on the same host machine, namely lab.zoo.cs.yale.edu.  In general, this will not be the case;  organizations often dedicate one or more machines completely to web-server activity, and these servers communicate with other machines that perform other functions.


1c.  The database
 

In HW2, the server-side application program that will be run is a database-management system called MySQL.  Database-management systems (dbmss) are one of the most important and ubiquitous types of software systems in use today; they allow organizations and individuals to store, retrieve, update, and modify their essential information, and most large organizations could not function without them. Using a dbms, an organization creates and uses adatabase, which is a collection of one or more related tables.Each table contains a set of records, the meaning of which depends on the natures of the particular database and the organization that owns it.  Users retrieve records from databases by submittingqueries, i.e., questions expressed in a formal language that is understood by the dbms.

The database in HW2 is just about the simplest one possible: It contains just one table, in which each record contains the name of a student enrolled in a fictitious course called Biology 101 and that students grades on each assignment and exam in the course. Hereinafter, we will refer succinctly to both the Biology 101 database and the one table in it as the DB.

An important part of what you will do in HW2 is submit queries to the DB using the form that we have provided: http://lab.cs.yale.edu/cs156/QF.html (hereinafter referred to succinctly as QF.html). We suggest that you submit one now.Display the form QF.html in your browser, select Assignment 1, select display all student records containing a grade equal to or lower than the value entered on the exam or assignment chosen, enter the number 100 in the Grade-Value box, and press the Submit form button at the bottom.A lot of information will then be displayed in your browser window; most of it will be explained in Section 1.d. below.For now, scroll down to the bottom of your browser window; the entire contents of the DB should be displayed.This is because the query you submitted asked for the records of all students who got a grade lower or equal to 100 on Assignment 1, and of course that includes all students: Any grade entered on QF.html must be an integer between 0 and 100; otherwise an error message will be displayed.

In practice, a complete database for an introductory biology course would contain more than this one table of grades.  Other tables might contain TAs and the students in their sections, laboratory exercises and the materials needed for them, HW and exam questions and solutions from previous years, etc.  However, CPSC156a is not a course about databases, and so this one table suffices for our purposes.
1d.  The transcript
 

The transcriptis the page displayed in your browser after you press the Submit button on the QF.html form.   Here are descriptions of the fields in a transcript.



1e.  Hidden form items
 

In HW1, you were introduced to several types of form items.  Here, you will see another type, namely hidden form items.  An item of type "hidden" is used only to convey a fixed piece of data from the client to the server; it does not cause the user to be asked to give an input.  If you are designing a web form that has to send from the client to the server a value that you know at the time you design the form, you can store that value in a hidden form item.  If, on the other hand, there is a value that can only be supplied by the user, you must use a type of form item that prompts the user to enter that value in the browser.  In particular, hidden form items can be used to spare users from having to re-enter the same fixed value every time they use the form.
QF.html contains several hidden form items that you should be aware of;  you will have to understand them to do this assignment and will have to modify some of them.

Form items:

Form item definitions:


2.  Homework questions
 


3.  Requirements
 
 

Your answers to Questions 2, 3, 6, 7, and 8 should all be in one file, prepared using Word or whatever text editor you are most comfortable with.  Your answer to Question 1 should consists of three transcripts in three separate files, and your answer to Question 4 should consist of one transcript in one file.  Finally, there should be two separate files for your answer to Question 5, one containing a modified query form and one containing a transcript.

Combine these seven files using WinZip or whatever compression program you used in HW1, and then submit the zip file using the same instructions that you used in HW1.