Reprinted from servervariables
ServervariablesSet to search for predefined environment variables.
Syntax
Request. servervariables (Server Environment Variable)
Parameters
-
-
Server Environment Variables
-
The name of the server environment variable to be retrieved. You can use the values listed below.
Variable |
Description |
All_http |
All HTTP header files sent by the client. |
All_raw |
Retrieve all titles in the unprocessed table. Different from all_raw, all_http puts HTTP _ prefix before the title file name, and the title name is always capitalized. When all_raw is used, the title name and value only appear when the client sends them. |
Appl_md_path |
Retrieve the metadatabase path of the isapi dll (WAM) application. |
Appl_physical_path |
Search for the physical path corresponding to the metabase path. IIS converts appl_md_path to a physical (directory) path to return values. |
Auth_password |
Enter this value in the authentication dialog box of the client. This variable is available only when basic authentication is used. |
Auth_type |
When a user accesses a protected script, the server is used to verify the user's authentication method. |
Auth_user |
Unauthenticated User Name. |
Cert_cookie |
The unique ID verified by the client, which is returned as a string. It can be used as a signature for verification by the entire client. |
Cert_flags |
If a client is verified, bit0 is 1. If the authenticated by the client is invalid (not in the CA list recognized by the server), bit1 is set to 1. |
Cert_issuer |
The issuer field in user verification (O = MS, ou = IAS, Cn = user name, c = USA ). |
Cert_keysize |
Number of digits of the Secure Socket Layer connection keyword, such as 128. |
Cert_secretkeysize |
The number of digits that the server verifies for a private keyword. For example, 1024. |
Cert_serialnumber |
The serial number field verified by the user. |
Cert_server_issuer |
The issuer field for server verification. |
Cert_server_subject |
Master field verified by the server. |
Cert_subject |
The main field verified by the client. |
Content_length |
The length of the content sent by the client. |
Content_type |
The data type of the content. Used Together with query of additional information, such as HTTP query get and postAnd put. |
Gateway_interface |
Modify the CGI specification used by the server. The format is CGI/revision. |
HTTP _ <Headername> |
HeadernameThe value stored in the title file. The title file not included in the table must be prefixed with HTTP _ServervariablesSet to retrieve its value. Note:Server Load balancerHeadernameThe underscore (_) in is interpreted as the break number in the actual title. For example, if you specify http_my_header, the server searches for the title file sent in the name of my-header. |
HTTPS |
If the request passes through the Secure Channel (SSL), on is returned. If the request comes from an insecure channel, return off. |
Https_keysize |
Number of digits of the Secure Socket Layer connection keyword, such as 128. |
Https_secretkeysize |
The number of digits that the server verifies for a private keyword. For example, 1024. |
Https_server_issuer |
The issuer field for server verification. |
Https_server_subject |
Master field verified by the server. |
Instance_id |
The ID of the text-formatted IIS instance. If the instance id is 1, it appears as a character. You can use this variable to retrieve the ID of the Web server instance to which the request belongs (in the metabase. |
Instance_meta_path |
The metabase path of the IIS instance that responds to the request. |
Local_addr |
Returns the server address that receives the request. This variable is very important if you look for the address used by the request on a multi-host machine bound with multiple IP addresses. |
Logon_user |
Log on to the Windows NT account. |
Path_info |
The additional path information provided by the client. You can use these virtual paths and the path_info server variable to access the script. If the information comes from the URL, It is decoded by the server before it reaches the CGI script. |
Path_translated |
The version converted by path_info. The variable obtains the path and performs necessary ing from virtual to physical. |
QUERY_STRING |
Query question marks (?) in an HTTP request (?) . |
Remote_addr |
The IP address of the remote host that sends the request. |
Remote_host |
The name of the host that sent the request. If the server does not have this information, it will set the mote_addr variable to null. |
Remote_user |
Unmapped user name string sent by the user. The name is the name actually sent by the user, which is opposite to the name modified by the server verification filter. |
Request_method |
This method is used to submit a request. It is equivalent to get, Head, post, and so on for HTTP. |
Script_name |
The virtual path for executing the script. The URL used for self-reference. |
SERVER_NAME |
The server host name, DNS alias, or IP address that appears in the Self-referenced ual. |
Server_port |
The port number for sending the request. |
Server_port_secure |
String that contains 0 or 1. If the security port processes the request, it is 1; otherwise, it is 0. |
Server_protocol |
Name and revision of the Request Information Protocol. Format:Protocol/Revision. |
Server_software |
Name and version of the server software that responds to the request and runs the gateway. Format:Name/Version. |
URL |
Provide the basic part of the URL. |
Note
If the title file sent by the client cannot be found in the preceding table, you can callRequest. servervariablesAdd the prefix of HTTP _ to the title file name to retrieve its value. For example, if the client sends a title File
Somenewheader: somenewvalue
You can search by using the following syntaxSomenewvalue
<% Request. servervariables ("http_somenewheader") %>
You can use repeat characters to traverse all server variable names cyclically. For example, use the following script to print all server names.
<Table> <tr> <TD> <B> server variable </B> </TD> <B> value </B> </TD> </tr> <% for each name in request. servervariables %> <tr> <TD> <% = Name %> </TD> <% = request. servervariables (name) %> </TD> </tr> </table> <% Next %>
Example
The following example usesRequestThe object displays some server variables.
<HTML> <! -- This example displays the content of several servervariables. --> all_http server variable = <% = request. servervariables ("all_http") %> <br> content_length server variable = <% = request. servervariables ("content_length") %> <br> content_type server variable = <% = request. servervariables ("content_type") %> <br> QUERY_STRING server variable = <% = request. servervariables ("QUERY_STRING") %> <br> server_software server variable = <% = request. servervariables ("server_software") %> <br>
Next exampleServervariablesThe Set inserts a hypertext link into the server name.
<A href = "http: // <% = request. servervariables (" SERVER_NAME ") %>/scripts/mypage. asp"> link to mypage. asp </a>
Apply
Request object
See
Clientcertificate,Cookies,Form,Querystring