HP e3000 Web Server CGI Programming (November 2008)
Figure 6. Phonebook HTML
When the user clicks on the "ADD" button, the following encoded string is sent to the CGI application:
name=Praveen&number=4081234567&ACTION=ADD
Since the format of CGI input is a standard, some good samaritans have put out "CGI parsing
libraries" on the WWW which can be downloaded and used. These libraries are available in many
popular languages. This paper has CGI parsing functions in three popular languages (C, Perl, and
Pascal) and should be sufficient for writing CGI programs in these languages.
Preparation
Before diving into the examples, set up a new group on your HP 3000 where all these programs can
be created and compiled. For example, create a new group called CGI as follows,
NEWGROUP CGI;CAP=BA,IA,PH
Your HP 3000 webserver should be set up before trying these examples. Make sure that the cgi-bin
directory is enabled for your webserver (via directives in the httpd.config file). Refer to your webserver
manual for further information. Once the webserver is setup and running, to test whether the your cgi-
bin/ has been set up correctly, create the following three line program and save it as 'cgitest' in the
cgi-bin/ directory.
echo "Content-type:text/plain"
echo
echo "WELCOME TO THE WORLD OF CGI"
Page
6
of
10
HP e3000 Web Server CGI Programming
11/13/2008
http://www.hp.com/cgi
-
bin/pf
-
new.cgi?IN=http://jazz.external.hp.com/papers/cgi
-
paper/c
...