Chapter 7 Lab

Generating Reports on Web Pages

The CGI script for this lab:

Tasks to Do for this Lab

Solution

Extra for Experts

Instead of multiple CGI scripts for each kind of report, it's better to just have one CGI script for all reports, and have it run a particular subroutine depending on the user's choice.

One way to accomplish this is via the PATH_INFO variable. This is text in the URL that occurs after the CGI script's name, but before the question mark that would indicate the start of the QUERY_STRING, e.g.

http://path/to/the.cgi/this/is/path_info?query_string
You can use the path_info method to get the value of the PATH_INFO variable. We will use it to select which report subroutine we want called.

Tasks to Do for Extra for Experts

Solution


 
Dan Keller Technical Services © 2000