This course ended on December 14, 2001

CPSC 371: Topics in Computer Science:
Web Site Programming from CGI to XML

   Department of Mathematics and Computer Science
   Hobart and William Smith Colleges

   Fall, 2001.

   Instructor:  David J. Eck  (

   Monday, Wednesday, Friday, 11:15--12:10 PM.
         Room Lansing 300.

   Course Handout:

On-line Materials:

Lab Worksheets
Lab 1 (August 31) Lab 2 (September 7) Lab 3 (September 14)
Lab 4, Part 1 (Sept. 21) Lab 4, Part 2 (Sept. 28) Lab 5 (October 5)
Lab 6 (October 19) Lab 7 (November 2) Lab 8 (November 9)
Lab 9, Part 1 (November 16) Lab 9, Part 2 (November 30)

Information about CS 371
will be posted each week as the course is taught
during the Fall term of 2001.

End of Term: December 3 to 14

Well, the course is rapidly winding down. We will meet in Lansing 300 on December 3 for a final regular class. The last two classes, on December 5 and 7, will be in the Gulick 208 computer lab.

Your final project should be finished by the scheduled final exam time, that is, no later than 4:30 on Friday, December 14. You should turn in printouts of any .php files that contain significant programming. Also, make sure I know where to look for your project on the Web. If you are working as a team, make sure that everyone's name is on the material that you turn in.

It would be a good idea for you to make an appointment to present your final project to me. (However, I do not absolutely require this.) There will be a sign-up sheet for appointments outside my office door.

I will have office hours during the reading period and exam week, which I will announce in class and post on my office door.

Fourteenth Week: November 26 to November 30

The third and final test will be given in class on Wednesday, November 28. The test will cover CSS, JavaScript, and XML. You can also expect one or two summary essay questions on Web site programming. An information sheet for the test is available.

I will continue to talk about XML on Monday, but whatever I cover then will not be on the test. Friday will be Part 2 of the XML lab. The lab report, which will be the last lab report of the term, will be due the following Wednesday, December 5.

Twelfth and Thirteenth Weeks: November 12 to November 19

This week begin our final topic for the term: XML. For the week of November 12, you should read Chapters 1, 2, and 12 of XML in a Nutshell. For November 19, you should read Chapter 3. We might also talk about some of the material in Chapter 4, if we have time. The lab this week will be on XML. The lab report will not be due until after the next XML lab on November 30.

There is a test coming up on Wednesday, November 28. This is the last test of the term. (There is no final exam.) The test will covers mostly CSS, JavaScript, and XML.

November 21 through 23 is Thanksgiving break. Have a nice holiday!

Eleventh Week: November 5 to November 9

We will be taking a brief look at JavaScript as a client-side Web scripting language this week, and this week's lab will be on JavaScript programming. The reading is Chapter 13 of HTML: The Complete Reference. See also the JavaScript links at the top of this page.

Everyone in the class should meet with me about their final project. Please sign up for a meeting time on the sheet outside my office door.

Tenth Week: October 29 to November 3

The main topic for this week is Cascading Style Sheets. You can read about them in Chapter 10 of HTML: The Complete Reference, and there is a CSS reference in Appendix B of that book. I have added links to a few on-line CSS references to the top of this page, including one at, which seems to be a very nice site for XML references in general.

Ninth Week: October 22 to 26

We have a test on Wednesday. On Friday, you will work on your final project in class.

Eighth Week: October 15 to 19

This week, we will be looking at Zope. The material you need to know will be covered in class and in lab. There is no formal reading assignment, but you can take a look at the Zope Book on line. I have put a printout of this book in the department computer lab.

On Friday in class, you should be turning in a proposal for a final project. You can turn in either a group proposal or an individual proposal. Give a brief description of the Web site you would like to design and the interactive features that it will have. This is not a final proposal. You can change your mind later. If you have an idea and are looking for people to work with, you might want to send out an announcement to the cpsc37101 mail list on Webmail describing your idea. I will get mail sent to the cpsc37101 list, along with everyone in the class.

Seventh Week: October 10 and 12

There is no new reading for this shortened week. We will continue the coverage of cookies and PHP sessions on Wednesday. As we approach the midpoint of the course, it is time to start thinking about the final project for the course. On Friday, in a change of plan, there will be no lab. Instead, we will meet in our regular classroom and we will talk about the final project.

For the final project, I would prefer to have people work in groups on reasonably ambitious projects. I will not absolutely rule out individual projects, but if you have an idea for a project, I hope that you will think about how the project can be structured to include other people. In any case, each project will have to be approved before you begin serious work.

The basic requirement for the final project is that it involve the creation of an interactive Web site that uses server-side programming. I expect that the programming will be done in PHP. After we look at Zope, some of you might want to think about using that instead, since it would be more appropriate for certain types of projects. You will have to do some programming for the project, but you are also permitted and even encouraged to incorporate features from open-source projects such as or If you use other people's work, you must clearly identify it as such.

Here are some examples of possible projects: A system for setting up Web sites for a college course; an system that supports two-user or multi-user games over the Web; a site for HWS computer science alumni and current students. Over the summer, CIO Brian Young suggested that some people in the course develop an on-line version of the HWS room lottery. (One student has already expressed interest in a Res-Ed site that would include this.) There might be other opportunities for sites that would find actual use on campus. There is also the possibility of making your project the start of an open-source project that could be continued at Note that it is OK for several different groups to work on similar projects.

If you don't come up with a better idea, I will expect you to work in a group on a system for setting up Web sites for college courses at HWS. Such a site could include: a syllabus, on-line discussions, a grade book for the professor, a way of sending email to the class, the possibility of posting lectures or slides from the course, and perhaps some way of submitting papers or other assignments.

Sixth Week: October 1 to 5.

On Monday of this week, we will have one more class on PHP and MySQL. On Wednesday, we will begin to cover PHP "sessions", our last topic on PHP. The lab on Friday will be Part 1 of a two-part lab on sessions. There is no lab report due next week.

The reading for the week is Chapters 25 and 26 of the PHP Bible.

A combined lab report for parts 1 and 2 of Lab 4 is due on Friday. There is no class next Monday, because of the two-day break next week.

Fifth Week: September 24 to 28.

There is a test on Monday. On Wednesday, we will continue talking about using MySQL in PHP. The lab on Friday, which is Part 2 of Lab 4, will also be devoted to this topic.

Fourth Week: September 17 t0 21.

This week, we begin to talk about databases, the MySQL database system, and using MySQL in PHP. Chapter 17 of the PHP Bible has basic information about SQL, and Chapter 18 covers using MySQL in PHP. However, not everything in these chapters is important. And on the other hand, we will use some features of SQL that are not mentioned in Chapter 17. The best place to look for the official word on SQL and MySQL is the SQL manual, which can be found on the cslab computers in the file /usr/share/doc/packages/mysql/manual.pdf. You can read this file with the acroread program (Adobe Acrobat Reader). Chapter 7 describes SQL as implemented in MySQL. A printout of Chapters 6 and 7 can be found in a binder in the Math/CS computer lab.

There is a test next Monday, September 27. An information sheet is available.

Third Week: September 10 to 14

This week, we will look at functions and arrays in PHP. Functions are very similar to functions in C++ or Java, except that there is no type information to worry about for the return value or for the parameters. Arrays are another story. Although you can use them more or less like arrays in Java, they are really another sort of thing altogether. In fact, PHP arrays are not even arrays in the usual sense. They are a weird combination of "hash table" and "linked list". Although I am asking you to read a few pages about objects and classes, you will not have to write new classes for this course. I might ask you to use a pre-existing class at some point in lab.

You should read the very introductory information on arrays and objects on pages 83 to 88 of the PHP Bible. Also read Chapters 8 and 11. However, only pages 123 to 137 and pages 201 to 220 are really required.

Second Week: September 3 to 7

The topic for the week is the basics of PHP, including control structures and variables. The reading also includes material on the HTML elements that can be used in forms.

Reading assignment for this week: Chapter 10, pages 404--430 in HTML: The Complete Reference and Chapters 4 and 5 of The PHP Bible. I also recommend that you read Chapter 1 in The PHP Bible for some background information on PHP.

For your information, here is a very tentative schedule of topics for the courses:

      Introduction                        1 week
      PHP basics                          1 week
      PHP functions and data structures   1 week
      PHP with files and MYSQL            2 weeks
      PHP sessions                        1 week
      Zope                                2 weeks
      Cascading Style Sheets              1 week
      The DOM and JavaScript              1 week
      XML                                 3 weeks

The schedule allows one week for the three in-class tests.

We will continue to meet on Fridays in Gulick 208, until further notice.

First Week: August 27 to 31

On the first day of the course, I will talk about what we will be doing for the rest of the semester. During the rest of the week I will review HTML and start on the basic ideas of CGI. HTML (HyperText Markup Language) is used to write Web pages. CGI (Common Gateway Interface) is the original specification that made it possible to create interactive Web sites.

It would be a good idea for you to obtain the book HTML: The Complete Reference, Third Edition, and familiarize yourself with it. You should at least look through the basic material on HTML in Chapters one through six. (You should also buy the book PHP 4 Bible, since we will begin using it next week. The remaining book, XML in a Nutshell, will not be used until later in the course.)

On Friday, we will meet in the computer lab in room Gulick 208.