mkscgi

Command

mkscgi provides a facility for running KornShell scripts on
HTTP servers through the Common Gateway Interface (CGI).
mkscgi also executes any binary and script when
they have a registry association.

mkscgi parses content returned from an HTML form,
and converts each field into a WWW_ environment variable.
It then executes the binary associated with the script specified in
extended path information of the HTML form statement.
For example, for the form statement

<form method="POST" action="/cgi-bin/mkscgi.exe/cgi-bin/mkscalc.ksh">

mkscgi reads the content returned from the browser,
parses each field into a WWW_ environment variable, then
passes those environment variables through to the script.
Additionally, all system environment variables are expanded and passed
to the script.

In the above example, the directory name (cgi-bin) following
mkscgi.exe is a virtual path defined by the server administrator.
The server expands the virtual path into the environment variable
PATH_TRANSLATED.

Use registry to make the registry association for a
custom script extension and binary:

Several example HTML and script files are included with PTC MKS Toolkit.
If they were not installed during setup and are not located in
$ROOTDIR/mksnt/www, then run PTC MKS Toolkit setup.exe.
At the Setup Type window choose Custom to install
the Internet Server Support files.

Basic installation of the example scripts assumes that your HTTP server
is configured to have a dedicated CGI directory and that PTC MKS Toolkit
is installed.

No changes or additions are required to browser mime types or to the registry.
First put the files into the right directories and then write your own
.htm and .ksh scripts.

Place mkscgi.exe and the example .ksh
files into the dedicated cgi-bin scripts directory.

Copy the .htm files and any files to download into the
document root directory.
Back up your default index.html or home.htm.
Copy mksdemo.htm to index.html or
home.htm.

mksvalid.pl and mksdnld.ksh must be configured with
the server name and the name of the file to be download.

Browser form content is parsed by mkscgi and placed into the
environment. Each form field name is prefixed with WWW_.
If a field name begins with an underbar, one underbar is removed.
Dots in a field name are converted to underbars.

REQUEST_METHOD

User defined in .html file.
Must be defined as POST or GET.

QUERY_STRING

Contains form content if REQUEST_METHOD is
GET.
If REQUEST_METHOD is POST it can contain
the URL-embedded constant information.
mkscgi does not process this embedded information.

CONTENT_LENGTH

Set by your web server.

PATH_TRANSLATED

Full path name of the specified script. The form statement extra path
information contains a virtual path which is expanded by the server.