views:

88

answers:

4

CGI scripts should have access to a list of environment variables set by the web server. What are their names?

+1  A: 

A quick Google search finds the what you need.

fuzzy lollipop
+2  A: 

The "hoohoo" machine at NCSA that has the CGI documentation is down, but here's what seems to be a mirror.

Ignacio Vazquez-Abrams
+4  A: 

See RFC 3875 for the CGI spec, which has all the info you need. :-)

From the RFC:

  meta-variable-name = "AUTH_TYPE" | "CONTENT_LENGTH" |
                       "CONTENT_TYPE" | "GATEWAY_INTERFACE" |
                       "PATH_INFO" | "PATH_TRANSLATED" |
                       "QUERY_STRING" | "REMOTE_ADDR" |
                       "REMOTE_HOST" | "REMOTE_IDENT" |
                       "REMOTE_USER" | "REQUEST_METHOD" |
                       "SCRIPT_NAME" | "SERVER_NAME" |
                       "SERVER_PORT" | "SERVER_PROTOCOL" |
                       "SERVER_SOFTWARE" | scheme |
                       protocol-var-name | extension-var-name
  protocol-var-name  = ( protocol | scheme ) "_" var-name
  scheme             = alpha *( alpha | digit | "+" | "-" | "." )
  var-name           = token
  extension-var-name = token
Chris Jester-Young