Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the environment variables of the CGI program

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you what are the relevant knowledge points about the environmental variables of the CGI program, the content is detailed, and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.

CGI environment variable

All CGI programs receive the following environment variables, which play an important role in CGI programs:

The variable name describes the value of the environment variable CONTENT_TYPE that indicates the MIME type of the information being passed. Currently, the environment variable CONTENT_TYPE is generally: application/x-www-form-urlencoded, which indicates that the data comes from the HTML form. CONTENT_LENGTH if the communication between the server and the CGI program is POST, this environment variable is the number of bytes of valid data that can be read from the standard input STDIN. This environment variable must be used when reading the entered data. COOKIE content within the HTTP_COOKIE client. HTTP_USER_AGENT provides customer browser information that contains the number of versions or other proprietary data. The value of the environment variable PATH_INFO represents additional path information immediately after the name of the CGI program. It often appears as a parameter of CGI programs. QUERY_STRING if the communication between the server and the CGI program is GET, the value of this environment variable is even if the message is passed. This information is followed by the name of the CGI program, with a question mark between the two'?' Separate. The value of the environment variable REMOTE_ADDR is the IP address of the client that sent the request, such as 192.168.1.67 above. This value always exists. And it is the unique identity that the Web client needs to provide to the Web server, which can be used in CGI programs to distinguish between different Web clients. The value of the environment variable REMOTE_HOST contains the hostname of the client that sent the CGI request. If you want to query is not supported, you do not need to define this environment variable. REQUEST_METHOD provides the methods that are called by the script. For scripts that use the HTTP/1.0 protocol, only GET and POST make sense. The full path to the SCRIPT_FILENAMECGI script the name of the SCRIPT_NAMECGI script SERVER_NAME this is the hostname, alias, or IP address of your WEB server. The value of the environment variable SERVER_SOFTWARE contains the name and version number of the HTTP server that called the CGI program. For example, the above values of Apache/2.2.14 (Unix) and above are all the contents of the article "what are the environment variables of CGI programs?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report