5% assure discount from here only

Wednesday, February 23, 2011

(22) What are the CGI Environment Variables?

Solution :

CGI Environment Variables plays an very important role in web application development. If you are using perl for developing web application then you must know about CGI Environment Variables. These are the series of some hidden values that the web server(apache or can be other) sends to every CGI program you run on browser. Your program can parse them and use the data they send. Environment variables are stored in a special hash named %ENV.

Most of the frequently used CGI Environment Variables are:

KeyValue
DOCUMENT_ROOT:The root directory of your server
CONTENT_LENGTH:The length, in bytes, of the input stream that is being passed through standard input.
PATH_INFO:The extra path information followin the script's path in the URL.
HTTP_COOKIE:The visitor's cookie, if one is set
HTTP_HOST:The hostname of the page being attempted
HTTP_REFERER:The URL of the page that called your program
HTTP_USER_AGENT:The browser type of the visitor
HTTPS:"on" if the program is being called through a secure server
PATH:The system path your server is running under
QUERY_STRING:The query string (see GET, below)
REMOTE_ADDR:The IP address of the visitor
REMOTE_HOST:The hostname of the visitor (if your server has reverse-name-lookups on; otherwise
this is the IP address again)
REMOTE_PORT:The port the visitor is connected to on the web server
REMOTE_USER:The visitor's username (for .htaccess-protected pages)
REQUEST_METHOD:GET or POST
REQUEST_URI:The interpreted pathname of the requested document or CGI (relative to the document
root)
SCRIPT_FILENAME:The full pathname of the current CGI
SCRIPT_NAME:The interpreted pathname of the current CGI (relative to the document root)
SERVER_ADMIN:The email address for your server's webmaster
SERVER_NAME:Your server's fully qualified domain name (e.g. www.cgi101.com)
SERVER_PORT:The port number your server is listening on
SERVER_SOFTWARE:The server software you're using (e.g. Apache 1.3)

No comments:

Post a Comment