CGI scripts should have access to a list of environment variables set by the web server. What are their names?
+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
2010-03-24 21:08:11
+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
2010-03-24 21:09:04