Fundamentals of Computer Science 1 (CS151 2003S)
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[EC]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Lab Writeups]
[Outlines]
[Project]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Misc:
[Scheme Reference]
[Scheme Report]
[CS151 2003S Gum]
[CS151 2002F]
[CS151 History]
[SamR]
Summary: In this lab, we continue our investigations of CGI scripting.
This lab is optional. It is intended for students who complete the first CGI lab early.
Useful Files:
a. Make copies of the following files:
b. Start DrScheme.
While we've been creating our HTML forms in a text editor, it is also possible to generate a form with a CGI script.
a. Look at newgreeting.ss
and see if you can figure out
what it does.
b. Load newgreeting.ss
from within DrScheme and execute
both greeting-form
and greeting-page
to see
that you understand what strings they generate.
c. Create a corresponding CGI file newgreeting.cgi
, but
don't create a corresponding HTML file. Load the CGI file in your browser
and see what happens.
d. Can you tell why we didn't have to create an HTML page for
newgreeting
?
Write a CGI script that takes a number as input and produces the square
root of that number as output. Since CGI variables are passed as strings,
you will probably want to use the string->number
and
number->string
procedurese to convert to and from numbers.
a. Look at colorful.ss
and see if you can determine what it
does.
b. Create colorful.cgi
, a CGI file that loads
colorful.ss
.
c. Load colorful.cgi
through your Web browser and try
entering different colors to see what happends.
d. What happens when you select the color yellow
? Why? Fix
the problem you've found in this step.
e. Extend colorful.ss
so that it supports more than those
four colors.
f. Extend colorful.ss
so that it takes both a background
color and a foreground color.
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[EC]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Lab Writeups]
[Outlines]
[Project]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Misc:
[Scheme Reference]
[Scheme Report]
[CS151 2003S Gum]
[CS151 2002F]
[CS151 History]
[SamR]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 6 09:28:59 2003.
The source to the document was last modified on Tue Feb 11 12:53:32 2003.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2003S/Labs/more-cgi.html
.
You may wish to
validate this document's HTML
;
;
Check with Bobby