Servertec CGI Tester
Examples
Hello World
Display Arguments
Display Headers
URL Redirect
CGI Tester
SSI Tester
Servlet Tag
Servlet Chaining
Log
Cookie Counter
Cookie Tester
Protected Page
List Employees
Connection Pool
Simple Form
Dump Form
Page Counter
File Upload
Session Tester
Context Tester
C++ .NET
C# .NET
J# .NET
Visual Basic .NET

Return

 

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 Administrator - Server form.

  • In Windows 9x/Me change the Servlet definition for CgiServlet as follows:

    Alias: CgiServlet
    Class File: stec.iws.CgiServlet
    Parameter: bindir=./cgi-bin
    Parameter: exec=c:\windows\command.com /c

  • In Windows NT/2000/2003 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 XP change the Servlet definition for CgiServlet as follows:

    Alias: CgiServlet
    Class File: stec.iws.CgiServlet
    Parameter: bindir=./cgi-bin
    Parameter: exec=c:\windows\system32\cmd.exe /c

In Windows NT/2000/2003 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.

[ view source ]

 top of page
Copyright © 1998-2005 Servertec. All rights reserved.
Privacy Statement.
Last Modified: Mon Sep 05 16:00:40 EDT 2005