Supplemental Scripts
Students in previous sessions have indicated needing more
example scripts to work with, particularly with respect to
using CGI.pm. I've written these scripts to supplement the
lesson 5 material and
I hope these help to pull the various topics together for
you.
All of these are revisions to the survey HTML and script
on pages 42-44 of chapter 5 in the CGI 101 book.
* First, I rewrote the survey.cgi script to use CGI.pm.
This will illustrate how it simplifies your script to use
CGI.pm's built in parsing and other functions.
- Working demo
- Text
of CGI script
* Second, I rewrote the script to combine the HTML form
and the CGI script into one. So, the first time the script
is called the form is displayed. The second time, the results
are displayed. This also uses CGI.pm.
- Working
demo
- Text
of CGI script
* Lastly, I rewrote the script slightly to use a different
method for the checkboxes on the HTML form. I don't like
how the textbook implements them -- using a different "name"
for each box and giving them all a value of "1". There
are better ways to use checkboxes for CGI scripting, and I've
illustrated that here.
- Working
demo
- Text
of CGI script
Jump
to Forums [Lesson 5]
|