Fundamentals of Computer Science I (CSC-151.02 2000F)

CGI Scripting


Exercise 0: Preparation

a. Make new copies of the following files in your public_html directory:

Remember that you can copy files by holding down the right mouse button on a link and then selecting ``Save Link As ...'' from the menu that pops up.

b. Create a file called cs.cgi in the same directory. It should contain the following lines (at the left margin).

export PATH="/net/bin:/usr/local/bin"
mzscheme -r

c. Share all those files. You might do the following in a shell window.

cd public_html
share *.ss
share cs.cgi

d. Make cs.cgi executable. In the same shell window, type

chmod a+x cs.cgi

e. Type cs.cgi in a shell window. Report on the results.

f. Try loading cs.cgi from your browser. Report on the results. If you get an error, try loading

Exercise 1: Trace the Code

Read through (and the accompanying files) and, to the best of your ability, explain what it does and how.

Exercise 2: Changing the Layout

a. Update so that it includes the text ``AKA nickname'' on a separate line, rather than in parentheses.

b. Check the effect of these changes by reloading cs.cgi.

Exercise 3: Adding Data

a. Add another course (you can make it up) to the list of CS courses.

b. Check the effect of this change by reloading cs.cgi.

Exercise 4: Extending the Course Record

a. Add a list of adjectives (as strings) to the course record.

b. Update course->html so that it prints the adjectives along with everything else.

c. Check the effect of this change by reloading cs.cgi.

Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.

This page may be found at

Source text last modified Wed Oct 11 10:03:25 2000.

This page generated on Wed Oct 11 10:04:39 2000 by Siteweaver. Validate this page's HTML.

Contact our webmaster at