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


More CGI Scripting

Exercises

Exercise 0: Preparation

a. Make a new copy of the following file in your public_html directory (you made a copy yesterday, but I've updated it).

b. Make copies of the following new 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.

c. If you haven't done so already, finish the first lab on CGI.

d. Create the file lookupcourse.cgi in your public_html directory.

#!/bin/bash
export PATH="/net/bin:/usr/local/bin"
mzscheme -r lookupcourse.ss

e. Create a similar file called lookupdept.cgi.

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

cd public_html
share *.ss
share *.cgi
share *.html

g. Make the CGI files executable. In the same shell window, type

chmod a+x *.cgi

Exercise 1: Look up up courses by number

a. Try loading lookupcourse.html from your browser and entering sample courses. Report on the results. Make sure to test courses likely to be in our database and courses likely to be missing.

If you get an error, try examining http://www.cs.grinnell.edu/~rebelsky/errlog.cgi.

b. Examine lookupcourse.ss and, to the best of your ability, explain what it does.

c. Examine lookupcourse.html and, to the best of your ability, explain what's going on in this file.

Exercise 2: Look up courses by department

a. Try loading lookupdept.html from your browser and entering sample departmental abbreviations. Report on the results. Make sure to test departments likely to be in our database and departments likely to be missing.

If you get an error, try examining http://www.cs.grinnell.edu/~rebelsky/errlog.cgi.

b. Examine lookupdept.ss and, to the best of your ability, explain what it does.

c. Examine lookupdept.html and, to the best of your ability, explain what's going on in this file.

Exercise 3: Look up courses by adjective

Following the pattern of the previous two examples, write a Web page, CGI script, and Scheme program that let you look up courses by adjective.


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 http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2000F/Labs/more-cgi.html

Source text last modified Wed Oct 11 10:05:20 2000.

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

Contact our webmaster at rebelsky@grinnell.edu