ALP Request.ServerVariables collection
Contains the environment variables related to the execution environment. Some of them are global, others are related to the current request.

Syntax:

Request.ServerVariables[(variable)[(index)|.Count]]

Parameters:

variable - can be string or numeric 1-based index of the variable name

index - is a 1-based index of the value for the specified variable

If a particular variable does not exists empty string is returned. In nearly all situations all variables has only one value thus index parameter will be rarely needed.

List of the standard variables:

PATH_TRANSLATED Contains the path containing the executed script
HTTPS Included only for compatibility - always "off"
APPL_PHYSICAL_PATH Contains the physical path to the root directory of the ALP application
GATWAY_INTERFACE In this version it returns CGI/1.1 (see CGI applications)
PATH_INFO Contains virtual path containing the script
SCRIPT_NAME Contains virtual path and script name, can be used to generate URL that points to the same script.
URL Contains the entire URL invoked the script excluding the server and protocol part.
QUERY_STRING Contains raw query string
REQUEST_METHOD HTTP method equivalent used to invoke the script - in ALP 1.0 it can be GET or POST
SERVER_NAME Contains server name part of the URL. See ALP URL syntax for details.
HTTP_HOST In ALP it is always equal to the SERVER_NAME
SERVER_PORT In ALP it is always 80 in order to disallow applications that do URL generation to add :port portion in the URL.
SERVER_PORT_SECURE In ALP always is 0
SERVER_PROTOCOL In ALP is always HTTP/1.0. Note that CCGA is not exactly HTTP server architecture thus it keeps nearly full compatibility with HTTP but there are many differences. In this case important thing is that protocol is transparent for the applications executed by some CCGA engine (including ALP). Thus this value exists only for compatibility.
SERVER_SOFTWARE Contains string describing the name and version of the engine that executes the script. See Execution context ASP samples.
HTTP_USER_AGENT In ALP 1.0 it is always Mozilla/4.0 (compatible; MSIE 4.01; Win32). Reason is that not all versions of the Internet Explorer pass the version values to the pluggable protocols different than http and https.

In this collection you will find also the environment variables defined by the system. They may vary from platform to platform, may include custom variables defined by the user and so on.

Examples:

Generating URL that points the same script with some parameters

JScript/VBScript:

<A HREF="<%= Request.ServerVariables("SCRIPT_NAME") %>?param1=a&param2=b">Link</A>

Remarks:

ServerVariables collection is implemented using the newObjects Collections components see Request collections comments for more information.

Applies to: Request object

See also: ALP URL

 

newObjects Copyright 2001-2006 newObjects [ ]