This example tests the Common Gateway Interface (CGI). It first displays
a form allowing GET/POST to be tested and once Submit Query is press it
dumps all CGI variables.
Before this example can be used the following changes must be made:
-
Shell Access must be enabled in the iServer Administration - Server form.
-
In Windows NT change the Servlet definition for CgiServlet as follows:
Alias: CgiServlet
Class File: stec.iws.CgiServlet
Parameter: bindir=./cgi-bin
Parameter: exec=c:\\winnt\\system32\\cmd.exe /c
-
In Windows 9x change the Servlet definition for CgiServlet as follows:
Alias: CgiServlet
Class File: stec.iws.CgiServlet
Parameter: bindir=./cgi-bin
Parameter: exec=c:\\command.com /c
-
In Linux/Unix change the Servlet definition for CgiServlet as follows:
Alias: CgiServlet
Class File: stec.iws.CgiServlet
Parameter: bindir=./cgi-bin
Parameter: exec=/bin/sh
In Windows NT QUERY_STRING and QUERY_STRING_UNESCAPED will display
The name specified is not recognized as an internal or external
command, operable program or batch file. for each & contained in
the QUERY_STRING.
Depending on how the File Type for .bat is defined, Microsoft Internet Explorer may prompt to Save this program to disk when this example is run. Simply press OK and edit the saved item to view the results.
This example uses cgitesterform.shtml , cgitester.shtml,
include.inc and cgitester.bat in Windows 9x/NT or
cgitester in Linux/Unix.
[ view source ]
[ run ]
|