[Contents] [Previous] [Next] [Index]

ssjs_getCGIVariable

Returns the value of the specified environment variable set in the server process, including some CGI variables.

Server-side function

Implemented in

Netscape Server 3.0

Syntax

ssjs_getCGIVariable(varName)

Parameters

varName
A string containing the name of the environment variable to retrieve.

Description

ssjs_getCGIVariable lets you access the environment variables set in the server process, including the CGI variables listed in Table 13.2.

Table 13.2 CGI variables accessible through ssjs_getCGIVariable  
Variable Description
AUTH_TYPE
The authorization type, if the request is protected by any type of authorization. Netscape web servers support HTTP basic access authorization. Example value: basic

HTTPS
If security is active on the server, the value of this variable is ON; otherwise, it is OFF. Example value: ON

HTTPS_KEYSIZE
The number of bits in the session key used to encrypt the session, if security is on. Example value: 128

HTTPS_SECRETKEYSIZE
The number of bits used to generate the server's private key. Example value: 128

PATH_INFO
Path information, as sent by the browser. Example value: /cgivars/cgivars.html

PATH_TRANSLATED
The actual system-specific pathname of the path contained in PATH_INFO. Example value: /usr/ns-home/myhttpd/js/samples/cgivars/cgivars.html

QUERY_STRING
Information from the requesting HTML page; if "?" is present, the information in the URL that comes after the "?". Example value: x=42

REMOTE_ADDR
The IP address of the host that submitted the request. Example value: 198.93.95.47

REMOTE_HOST
If DNS is turned on for the server, the name of the host that submitted the request; otherwise, its IP address. Example value: www.netscape.com

REMOTE_USER
The name of the local HTTP user of the web browser, if HTTP access authorization has been activated for this URL. Note that this is not a way to determine the user name of any person accessing your program. Example value: ksmith

REQUEST_METHOD
The HTTP method associated with the request. An application can use this to determine the proper response to a request. Example value: GET

SCRIPT_NAME
The pathname to this page, as it appears in the URL. Example value: cgivars.html

SERVER_NAME
The hostname or IP address on which the JavaScript application is running, as it appears in the URL. Example value: piccolo.mcom.com

SERVER_PORT
The TCP port on which the server is running. Example value: 2020

SERVER_PROTOCOL
The HTTP protocol level supported by the client's software. Example value: HTTP/1.0

SERVER_URL
The URL that the user typed to access this server. Example value: https://piccolo:2020

If you supply an argument that isn't one of the CGI variables listed in n, the runtime engine looks for an environment variable by that name in the server environment. If found, the runtime engine returns the value; otherwise, it returns null. For example, the following code assigns the value of the standard CLASSPATH environment variable to the JavaScript variable classpath:

classpath = ssjs_getCGIVariable("CLASSPATH");


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 16:38:00


Copyright © 1997 Netscape Communications Corporation