ServerVariables

The ServerVariables collection retrieves the values of predetermined server environment variables.

Syntax

Request.ServerVariables (server environment variable)

 

Parameters
server environment variable
Specifies the name of the server environment variable to retrieve. It can be one of the following values.
Variable Description
APPL_PHYSICAL_PATH Retrieves the physical path corresponding to the metabase path. IIS converts the APPL_MD_PATH to the physical (directory) path to return this value.
PROJECT_PATH Returns the path to the published project.
CONTENT_NAME Returns the name of the current content.
HIT_DATE [Tracking only] Return the date of the click or open event.
HTTP_REFERER [Tracking only] Returns a string containing the URL of the page that referred the request to the redirector.
HTTP_USER_AGENT [Tracking only] Returns a string describing the client mail software that sent the request.
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 [Tracking only] Returns the IP address of the receiver who as clicked on the link.
SCRIPT_NAME Gives the base portion of the script being executed. 
SERVER_NAME The server's host name, DNS alias, or IP address as it would appear in self-referencing URLs.
SERVER_SOFTWARE The name and version of the server software that answers the request and runs the gateway. The format is name/version.
URL Gives the base portion of the URL.
[Tracking] Returns a string containing either open when a message is open or the link URL when a link is clicked.
URL_NAME Gives the name of the link that has been clicked, or an empty string if the link does not have a name.

Example

This example uses the For Each loop to iterate through each existing server variable name. Some will be empty if you have Anonymous Access enabled. The following script prints out all of the server variables in a table:

<TABLE BORDER="1">
<TR><TD><B>Server Variable</B></TD><TD><B>Value</B></TD></TR>
<% For Each strKey In Request.ServerVariables %>
<TR>
<TD><%= strKey %></TD>
<TD><%= Request.ServerVariables(strKey) %></TD>
</TR>
<% Next %>
</TABLE>
 
Applies To

Request Object

See Also

QueryString



©2001-2015 eMill. All trademarks property of their owners.