[TOC] [Prev] [Next] [Bottom]



<@CGIPARAM>

Syntax

<@CGIPARAM NAME=name [COOKIE=cookie] [ENCODING=encoding]>

Description

Evaluates to the value of the specified CGI attribute. CGI attributes are values passed to Tango Server by your Web server. CGI attributes are passed whether you are using the CGI or the plug-in version of Tango Server.

The following table shows valid values for the NAME attribute and descriptions of the value returned by each.

Attribute Name

Description

CLIENT_ADDRESS

The fully-qualified domain name of the user who called the application file, if your Web server is set to do DNS lookups; otherwise, this attribute contains the user's IP address. For example, "fred.xyz.com".

CLIENT_IP

The IP address of the user who called the application file. For example, "205.189.228.30".

CONTENT_TYPE

The MIME type of the HTTP request contents.

FROM_USER

Rarely returns anything; with some older Web browser applications, the user's e-mail address.

HTTP_COOKIE

Returns the value of the HTTP cookie specified in the COOKIE attribute. For example, <@CGIPARAM NAME="HTTP_COOKIE" COOKIE="SICode"> returns the value of the SICode cookie. (This attribute is retained for backwards compatibility with Tango 2.3. It is recommended that you use <@VAR> with SCOPE="COOKIE" to return the values of cookies in Tango 3.0. See "<@VAR>" .)

HTTP_SEARCH_ARGS

Text after question mark (?) in the URL.

METHOD

The HTTP request method used for the current request. If a normal URL call, or form submitted with the GET method, "GET"; if a form submitted with the POST method, "POST".

PATH_ARGS

Text after the Tango CGI name and before any search arguments in the URL. If using the plug-in, or suffix-mapping to call the CGI automatically, no value is returned by this attribute. You may also use the <@APPFILE> meta tag to get this value (it works regardless of calling method and whether you use the plug-in or CGI). For example, a "/" after the CGI name indicates the beginning of the path args.

POST_ARGS

The raw POST (form submission) argument contents, containing the names and values of all form fields.

REFERER

The URL of the page from which the current request was initiated. Not provided by all Web browsers. (The misspelling of this attribute is for consistency with the CGI specification.)

SCRIPT_NAME

Returns the CGI portion of the URL.

SERVER_NAME

Fully-qualified domain name of the Web server, if your Web server is set to do DNS lookups; otherwise, this attribute contains the server's IP address. For example, "www.pervasive.com".

SERVER_PORT

The TCP/IP port on which the Web server is running. A typical Web server runs on port 80.

USERNAME

The user name, obtained with HTTP authentication, of the user who requested the URL. This attribute is available only if the URL used to call the current application file required authentication by the Web server software.

USER_AGENT

The internal name of the Web browser application being used to request the URL. This often contains information about the platform (Mac OS, Windows, etc.) on which the Web browser is running, and the application's version. For example, Internet Explorer 3.0 for Macintosh returns Mozilla/2.0 (compatible; MSIE 3.0; Mac_PowerPC).

Mac OS

The parameters listed in the following table are available under the Mac OS only. Some may be available only with the StarNine WebSTAR server. Check your server documentation to see if it supports a particular CGI parameter.

Parameter

Description

ACTION

The name of the Web server action used to call Tango.

ACTION_PATH

The path from the Web server application to the Tango CGI used to call the current application file. If using the plug-in, returns "Tango".

FULL_REQUEST

The entire contents of the current HTTP request, including the URL and any POST arguments.

PASSWORD

The password, obtained with HTTP authentication, of the user who requested the URL. This parameter is available only if the URL used to call the current application file is protected by a Web server realm.

SCRIPT_NAME

If using the plug-in, or if the Tango CGI is called with a Web server action, returns the application file path and name; otherwise, returns the path and name of the Tango CGI.

Example

<P>Hi there, <TT><@CGIPARAM NAME=CLIENT_ADDRESS>
</TT>. You are connected to <TT><@CGIPARAM NAME=SERVER_NAME></TT>, port <@CGIPARAM NAME=SERVER_PORT>
.

This returns a personalized greeting to the client, for example:

Hi there, whitman.leavesofgrass.com. You are connected to baudelaire.flowersofevil.com, port 80.

See Also

Encoding Attribute



[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1998, Pervasive Software Inc. All rights reserved.