As HTTP servers and Web clients exchange data, the HTTP protocol sends a series of header fields containing information about the data being transferred over the Web. These header fields can, in turn, be passed to any program on your HTTP server. Because the information in these variables can be useful in your Panther Web application, Panther converts some of these header fields to global variables that can be accessed through JPL procedures or C functions.
An HTTP header field has a corresponding Panther HTTP variable. The Panther variable name begins with
@cgi_ followed by the HTTP field name in lower case. The Panther HTTP variables are read-only and are automatically reset on each
POST of a Panther screen. Because Panther updates these variables automatically, copy their values elsewhere if you need them for a subsequent
Common uses of the HTTP variables include:
For example, this JPL procedure builds a URL for a link with A Panther Gallery sample entitled HTTP Variables is accessible from the Web application server at:
// This procedure sets dynamic label's
// default_link property
home->default_link = "http:://" ## \
@cgi_server_name ## \
@cgi_script_name ## "/home.scr"
For example, this JPL procedure builds a URL for a link with
A Panther Gallery sample entitled HTTP Variables is accessible from the Web application server at:
POSTis used to submit data back to the server.
POSTis used to submit data back to the server. For Panther, this variable is set to:
The basic MIME types are listed in the following table:
Binary data that can be executed or used by another application
Encapsulated mail message
Multiple parts possibly consisting of many data types
A sample value would be:
You can use the contents of this variable to determine which image formats a browser can accept. For example, the following string indicates that the browser can display PNG, JPEG and GIF images:
For Panther applications, this information is only useful on
GET events. If the user enters a Panther application from elsewhere, for example from another website, this variable will specify that location, which can then be logged if desired.
You can determine the format for a particular browser only by experimentation. For example, the value sent from 32 bit Microsoft Internet Explorer 10.0 running on a 64 bit Windows 7 system might be:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
Panther uses this information to determine which Panther screen to open. For the example, this variable would be:
DOCROOT, to the path specified in
If the server's
DOCROOT directory is /
usr/local/htdocs, the variable would have the following value for the screen listed in the example:
For more information on URL encoding, refer to "Encoding Parameters in the URL."
GETmethod is used when the user enters a specific URL or activates a hyperlink. The
POSTmethod is used when the user submits a form. Using this variable, you can choose which portions of your code to execute for each method.
This is 123 in the example. Port numbers are useful if there are multiple servers running on the same machine, each calling the same Panther executable.
A sample value for this variable would be:
The following examples are typical values:
Apache/1.3.14 (Unix) (Red-Hat/Linux) PHP/4.0.3pl1