A more friendly CGI development system, WinCGI

Source: Internet
Author: User


 

  CGI development is too complex in some ways, mainly because it is used to obtain environment variables and decompose/decode data. In Windows, you can use WinCGI for development. The advantage of WinCGI is that it reduces the burden on developers to break down/decode data and provides a unified input/output method.

InDuring WinCGI program execution, the first parameter is a file name, for example, yourCGI.exe para.txt. All environment variables and parameter information are recorded in this file, the structure of the file is the same as that of the INI file. Therefore, all parameters can be retrieved using the standard function GetPrivateProfileString provided by Windows. In addition, all the data in the file has been decoded and can be directly used.

The parameter file contains the following areas (Section)

  • [CGI]
  • [Accept]
  • [System]
  • [Extra Headers]
  • [Form Literal]
  • [Form External]
  • [Form File]
  • [Form Huge]

The file format is as follows:

[CGI]
CGI Version = CGI/1.2 (Win)
Query String = XXXXXX
[Section]
Key = value
Key = value
...

The following data is particularly useful to us in this parameter file:

The keywords in the [CGI] area record the system parameters, the browser of the other party, the IP address of the other party, and other information. Some common keywords are listed below:

  • Request Method: data transmission Method. If the transmission Method is GET, you can also check the value of the Query String keyword to obtain the transmitted data, otherwise, you must read the [Form Literal] area to obtain the input.
  • Request Protocol: the Protocol and version used, such as HTTP/1.0.
  • From: The email address of the browser user.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.