CGI Lab 1

CS 318

Feb. 9, 2000

The purposes of this lab are to gain experience with form/CGI interaction and CGI.pm. CGI.pm is used to read the form parameters and generate dynamic HTML. Work in groups of two, different from last time.

  1. You can see the final result at
    http://phoenix.goucher.edu/~kelliher/s2000/cs318/minmax.html .

  2. Login to phoenix. Create the directory cgi-bin as a sub-directory of public_html, which is a sub-directory of your home directory. Make sure both directories are public. (First create public_html if it does not exist.)

  3. Copy the file ~kelliher/pub/cs318/minmax.html to your public_html directory. Change the action attribute of the FORM tag. Make the file public. Make sure it is visible to a browser.

  4. Copy the file ~kelliher/pub/cs318/minMax.cgi to your cgi-bin directory. Make it publicly executable. Make sure it is visible to a browser.

  5. Add code to the CGI program to print the name passed in. Test the program like this:
    % echo "name=Tom" | ./minMax.cgi
    

  6. Add code to the CGI program to parse the number list and print the numbers. Test the program like this:
    % echo "name=Tom&list=1,5,9" | ./minMax.cgi
    

  7. Add the minmax subroutine to the CGI program. Modify the program so that the name, min, and max values are printed. Test as before.

  8. Add code to the CGI program to generate an HTML document. Test as before. Make sure valid HTML is being generated.

  9. Test the form/CGI interaction by submitting the form from the browser.



Thomas P. Kelliher
Wed Feb 9 12:52:40 EST 2000
Tom Kelliher