Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 ASP Articles

As a part of the communication between the client browser and the IIS server which results in the production of a web page, additional information is also obtained about both the server and the client. This information is made available in ASP under the Request.ServerVariables collection. The Request.ServerVariables collection makes available information such as the query string, path and file being viewed.

Variable Description
ALL_HTTP Returns all of the HTTP headers sent by the client. Always prefixed with HTTP_ and capitalised
ALL_RAW Returns all headers in a raw format
APPL_MD_PATH Returns the meta base path for the application for the ISAPI DLL
APPL_PHYSICAL_PATH Returns the physical path corresponding to the meta base path
AUTH_PASSWORD Returns the value entered in the client's authentication dialog
AUTH_TYPE This is the authentication method which is used by the server when it validates users as they attempt to access a protected script.
AUTH_USER Returns the raw authenticated user name
CERT_COOKIE Returns the unique ID for the client certificate as a string
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
CERT_ISSUER Returns the issuer field of the client certificate
CERT_KEYSIZE The number of bits in the Secure Sockets Layer connection key size. For example, 128.
CERT_SECRETKEYSIZE The number of bits in the server certificate private key. For example, 1024.
CERT_SERIALNUMBER Serial number field of the client certificate.
CERT_SERVER_ISSUER Issuer field of the server certificate.
CERT_SERVER_SUBJECT Subject field of the server certificate.
CERT_SUBJECT Subject field of the client certificate.
CONTENT_LENGTH The length of the content as reported by the client.
CONTENT_TYPE The data type of the content. Used with queries that have attached information, such as the HTTP queries POST and PUT.
GATEWAY_INTERFACE The revision of the CGI specification used by the server. Format: CGI/revision.
HTTP_ This is the value stored in the header HeaderName. Any header other than those listed in this table must be prefixed by "HTTP_" in order for the ServerVariables collection to retrieve its value.

Note: The server interprets any underscore (_) characters in HeaderName as dashes in the actual header. For example if you specify HTTP_MY_HEADER, the server searches for a header sent as MY-HEADER.

HTTPS_KEYSIZE The number of bits in the Secure Sockets Layer connection key size. For example, 128.
HTTPS_SECTRETKEYSIZE The number of bits in the server certificate private key. For example, 1024.
HTTPS_SERVER_ISSUER Issuer field of the server certificate.
HTTPS_SERVER_SUBJECT Subject field of the server certificate.
INSTANCE_ID This is the ID for the IIS instance in textual format. If the instance ID is 1, it appears as a string.
INSTANCE_META_PATH The metabase path for the instance of IIS that responds to the request.
LOCAL_ADDR The Server Address on which the request came in. Especially useful on a server which is multi-homed, as it provides details as to on which interface the request came in on.
LOGON_USER The Windows account that the user is logged into.
PATH_INFO Extra path information as given by the client. You can access scripts by using their virtual path and the PATH_INFO server variable. If this information comes from a URL it is decoded by the server before it is passed to the CGI script.
PATH_TRANSLATED A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping.
QUERY_STRING Query information stored in the string following the question mark (?) in the HTTP request.
REMOTE_ADDR The IP address of the remote host making the request.
REMOTE_HOST The name of the host making the request. If the server does not have this information, it will set REMOTE_ADDR and leave this empty.
REMOTE_USER Returns an unmapped user-name as a string sent in by the user
REQUEST_METHOD The method used to make the request. For HTTP, this is GET, HEAD, POST, and so on.
SCRIPT_MAP Gives the base portion of the URL.
SCRIPT_NAME A virtual path to the script being executed. This is used for self-referencing URLs.
SERVER_NAME The server's host name, DNS alias, or IP address as it would appear in self-referencing URLs.
SERVER_PORT The port number to which the request was sent.
SERVER_PORT_SECURE A string that contains either 0 or 1. If the request is being handled on the secure port, then this will be 1. Otherwise, it will be 0.
SERVER_PROTOCOL The name and revision of the request information protocol. Format: protocol/revision.
SERVER_SOFTWARE The name and version of the server software answering the request (and running the gateway). Format: name/version.
URL Gives the base portion of the URL.
HTTP_ACCEPT Returns the value of the Accept header.
HTTP_ACCEPT_LANGUAGE A string describing the language to be used for displaying content.
HTTP_CONNECTION ?
HTTP_HOST The name of the Web server. This may or may not be the same as SERVER_NAME depending on the type of name resolution used on the Web server (IP address, host header).
HTTP_USER_AGENT A string describing the browser that sent the request.
HTTP_ACCEPT_CHARSET -
HTTP_CACHE_CONTROL -
HTTP_X_FORWARDED_FOR If the user accesses the Internet via a proxy server, then this will contain the IP address of the proxy server.

Using Request.serverVariables

The values of the ServerVariables variables may be obtained by simply assigning them to a variable. The following example illustrates how to obtain the IP address of the client computer.

<%
tempValue = request.ServerVariables("REMOTE_ADDR")
%>

The full set of names and values may be obtained using the following example:

<%
For Each name In Request.ServerVariables
response.write(Request.ServerVariables("name"))
Next
%>

NAT July 2005 (Revised)


This article viewed: 3905 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Tuesday, May 13, 2008