Skip to main content

CGI Environment Variables

So here goes the list of all the Environment variables that are inbuilt and can be used with ur CGI script:



Variable NameValue
DOCUMENT_ROOTThe root directory of your server
HTTP_COOKIEThe visitor's cookie, if one is set
HTTP_HOSTThe hostname of your server
HTTP_REFERERThe URL of the page that called your script
HTTP_USER_AGENTThe browser type of the visitor
HTTPS"on" if the script is being called through a secure server
PATHThe system path your server is running under
QUERY_STRINGThe query string (see GET, below)
REMOTE_ADDRThe IP address of the visitor
REMOTE_HOSTThe hostname of the visitor (if your server has reverse-name-lookups on; otherwise this is the IP address again)
REMOTE_PORTThe port the visitor is connected to on the web server
REMOTE_USERThe visitor's username (for .htaccess-protected pages)
REQUEST_METHODGET or POST
REQUEST_URIThe interpreted pathname of the requested document or CGI (relative to the document root)
SCRIPT_FILENAMEThe full pathname of the current CGI
SCRIPT_NAMEThe interpreted pathname of the current CGI (relative to the document root)
SERVER_ADMINThe email address for your server's webmaster
SERVER_NAMEYour server's fully qualified domain name (e.g. www.cgi101.com)
SERVER_PORTThe port number your server is listening on
SERVER_SOFTWAREThe server software you're using (such as Apache 1.3)


Comments

Popular posts from this blog

Difference between is_file and file_exists

If you want to know that the argument supplied is a file or not use is_file() file_exists() will take both file and directory as input and return true if they exists. So, unless you specifically want to check if the argument passed is a file use is_file otherwise use file_exists()

thanks 2 the person who wrote this!

“This is the thing: When you hit 28 or 30, everything begins to divide. You can see very clearly two kinds of people. On one side, people who have used their 20s to learn and grow, to find … themselves and their dreams, people who know what works and what doesn’t, who have pushed through to become real live adults. Then there’s the other kind, who are hanging onto college, or high school even, with all their might. They’ve stayed in jobs they hate, because they’re too scared to get another one. They’ve stayed with men or women who are good but not great, because they don’t want to be lonely. … they mean to develop intimate friendships, they mean to stop drinking like life is one big frat party. But they don’t do those things, so they live in an extended adolescence, no closer to adulthood than when they graduated.  Don’t be like that. Don’t get stuck. Move, travel, take a class, take a risk. There is a season for wildness and a season for settledness, and this is neither. This sea...