ASP(Active Server Page)에는 ServerVariables라고 하는 Request의 일부인 콜렉션이 존재한다. 이 함수를 사용하여 사용자 및 운영중인 서버의 정보를 알 수 있도록 기본 환경 정보를 제공한다.
The ServerVariables collection is used to retrieve the server variable values.
Syntax
Request.ServerVariables (server_variable)
Parameter |
Description |
server_variable |
Required. The name of server variable to retrieve |
Server Variables
Variable |
Description |
ALL_HTTP |
Returns all HTTP headers sent by the client. Always prefixed with HTTP_ and capitalized Client로 보내진 모든 HTTP headers를 반환한다. 항상 접두사 HTTP_가 있어야 하고 대문자이어야 한다. |
ALL_RAW |
Returns all headers in raw form Raw 형태로 모든 header들을 반환한다. |
APPL_MD_PATH |
Returns the meta base path for the application for the ISAPI DLL ISAPI DLL에 대한 application에 대한 meta base path를 반환한다. |
APPL_PHYSICAL_PATH |
Returns the physical path corresponding to the meta base path Meta base path에 상응하는 물리적 경로를 반환한다. |
AUTH_PASSWORD |
Returns the value entered in the client's authentication dialog Client의 authentication dialog안에 입력된 값을 반환한다. |
AUTH_TYPE |
The authentication method that the server uses to validate users 서버가 사용자를 확인하기 위해 사용하는 authentication method |
AUTH_USER |
Returns the raw authenticated user name 인증된 사용자이름을 반환한다. |
CERT_COOKIE |
Returns the unique ID for client certificate as a string string으로서 client certificate에 대한 유일한 ID를 반환한다. |
CERT_FLAGS | bit0 is set to 1 if the client certificate is present and bit1 is set to 1 if the cCertification authority of the client certificate is not valid Client certificate가 현시점이라면 bit0을 1로 설정하고 client certificate의 Certification authority가 유효하지 않다면 bit1을 1로 설정한다. |
CERT_ISSUER | Returns the issuer field of the client certificate Client certificate의 issuer field를 반환한다. |
CERT_KEYSIZE | Returns the number of bits in Secure Sockets Layer connection key size Secure Sockets Layer connection key size로 bits의 숫자를 반환한다. |
CERT_SECRETKEYSIZE | Returns the number of bits in server certificate private key server certificate private key로 bits의 숫자를 반환한다. |
CERT_SERIALNUMBER |
Returns the serial number field of the client certificate Client certificate의 serial number field를 반환한다. |
CERT_SERVER_ISSUER | Returns the issuer field of the server certificate Server certificate의 issuer field를 반환한다. |
CERT_SERVER_SUBJECT | Returns the subject field of the server certificate Certificate의 subject field를 반환한다. |
CERT_SUBJECT | Returns the subject field of the client certificate Client certificate의 subject field를 반환한다. |
CONTENT_LENGTH | Returns the length of the content as sent by the client Client에 보내진 content의 길이를 반환한다. |
CONTENT_TYPE | Returns the data type of the content Content의 data type을 반환한다. |
GATEWAY_INTERFACE | Returns the revision of the CGI specification used by the server 서버에 의해 사용되는 CGI specification의 revision을 반환한다. |
HTTP_<HeaderName> | Returns the value stored in the header HeaderName header HeaderName 안에 저장된 값을 반환한다. |
HTTP_ACCEPT | Returns the value of the Accept header Accept header의 값을 반환한다. |
HTTP_ACCEPT_LANGUAGE | Returns a string describing the language to use for displaying content Content를 표시하기 위해 사용되는 언어를 설명한 string을 반환한다. |
HTTP_COOKIE | Returns the cookie string included with the request Request에 포함된 cookie string을 반환한다. |
HTTP_REFERER | Returns a string containing the URL of the page that referred the request to the current page using an <a> tag. If the page is redirected, HTTP_REFERER is empty <a> tag를 사용하여 현재 페이지에 대한 요청을 참조하는 페이지의 URL을 포함하고 있는 string을 반환한다. 페이지가 redirect되었다면, HTTP_REFERER은 empty가 된다. |
HTTP_USER_AGENT | Returns a string describing the browser that sent the request 요청을 보낸 브라우저를 설명하는 string을 반환한다. |
HTTPS | Returns ON if the request came in through secure channel or OFF if the request came in through a non-secure channel 요청이 Secure channel을 통해 오면 ON, 그렇지 않다면 OFF를 반환한다. |
HTTPS_KEYSIZE | Returns the number of bits in Secure Sockets Layer connection key size Secure Sockets Layer connection key size로 bits의 숫자를 반환한다. |
HTTPS_SECRETKEYSIZE | Returns the number of bits in server certificate private key Server certificate private key 로 bits의 숫자를 반환한다 |
HTTPS_SERVER_ISSUER | Returns the issuer field of the server certificate Server certificate의 issuer field를 반환한다 |
HTTPS_SERVER_SUBJECT | Returns the subject field of the server certificate Server certificate의 subject field를 반환한다. |
INSTANCE_ID | The ID for the IIS instance in text format text format의 IIS instance에 대한 ID |
INSTANCE_META_PATH | The meta base path for the instance of IIS that responds to the request Request에 응답하는 IIS의 instance에 대한 meta base path |
LOCAL_ADDR | Returns the server address on which the request came in Request가 오는 server address를 반환한다. |
LOGON_USER | Returns the Windows account that the user is logged into 사용자가 로그한 Windows account를 반환한다. |
PATH_INFO | Returns extra path information as given by the client Client에 의해 주어진 extra path 정보를 반환한다. |
PATH_TRANSLATED | A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping Path를 취하고 virtual-to-physical mapping를 수행하는 PATH_INFO의 translate된 version |
QUERY_STRING | Returns the query information stored in the string following the question mark (?) in the HTTP request HTTP request안의 question mark (?)다음에 저장된 query 정보를 반환한다. |
REMOTE_ADDR | Returns the IP address of the remote host making the request Request를 만드는 remote host의 IP address를 반환한다. |
REMOTE_HOST | Returns the name of the host making the request Request를 만드는 remote host의 이름을 반환한다. |
REMOTE_USER | Returns an unmapped user-name string sent in by the user User에 의해 보내진 unmapped user-name string을 반환한다. |
REQUEST_METHOD | Returns the method used to make the request Request를 만들기 위해 사용되는 method를 반환한다. |
SCRIPT_NAME | Returns a virtual path to the script being executed 스크립트가 실행 될 virtual path를 반환한다. |
SERVER_NAME | Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs Server의 host name, DNS alias, 또는 IP address를 반환한다. |
SERVER_PORT | Returns the port number to which the request was sent Request가 보내진 port번호를 반환한다. |
SERVER_PORT_SECURE | Returns a string that contains 0 or 1. If the request is being handled on the secure port, it will be 1. Otherwise, it will be 0 0 또는 1을 포함하고 있는 string을 반환한다. Request가 secure port에서 처리된다면 1이고 그렇지 않다면 0이다. |
SERVER_PROTOCOL | Returns the name and revision of the request information protocol request information protocol의 이름과 revision을 반환한다. |
SERVER_SOFTWARE | Returns the name and version of the server software that answers the request and runs the gateway Request에 답하고 gateway를 실행하는 server software의 이름과 version을 반환한다. |
URL | Returns the base portion of the URL URL의 base portion을 반환한다. |
You can loop through all of the server variables like this:
for each x in Request.ServerVariables
response.write(x & "<br>")
next
%>
The following example demonstrates how to find out the visitor's browser type, IP address, and more:
<body>
<p>
<b>You are browsing this site with:</b>
<%Response.Write(Request.ServerVariables("http_user_agent"))%>
</p>
<p>
<b>Your IP address is:</b>
<%Response.Write(Request.ServerVariables("remote_addr"))%>
</p>
<p>
<b>The DNS lookup of the IP address is:</b>
<%Response.Write(Request.ServerVariables("remote_host"))%>
</p>
<p>
<b>The method used to call the page:</b>
<%Response.Write(Request.ServerVariables("request_method"))%>
</p>
<p>
<b>The server's domain name:</b>
<%Response.Write(Request.ServerVariables("server_name"))%>
</p>
<p>
<b>The server's port:</b>
<%Response.Write(Request.ServerVariables("server_port"))%>
</p>
<p>
<b>The server's software:</b>
<%Response.Write(Request.ServerVariables("server_software"))%>
</p>
</body>
</html>
'컴퓨터' 카테고리의 다른 글
[MDB] Database 문자열 합치기 (0) | 2014.09.26 |
---|---|
[MDB] SELECT ... LIKE 사용방법 (0) | 2014.09.02 |
[MDB] Oracle의 DECODE, SWITCH CASE (0) | 2014.08.23 |
[asp] 수학 함수 (0) | 2014.05.27 |
[asp] 동적배열 ReDim Preserve (0) | 2014.05.19 |