CGI Environment variables

The Common Gateway Interface runs an external program (a 'CGI script') as a result of a client request and returns the output of the program to the client. CGI defines the interface between the web server and the CGI script.

Useful references:

#!/usr/bin/perl
print STDOUT <<HERE;
Content-Type: text/plain
Status: 200 OK
Some Environment Variables:
The server host name is: $ENV{SERVER_NAME}
and the client is : $ENV{HTTP_USER_AGENT}
HERE

This script produces output like:

Some Environment Variables:
The server host name is : digital.zeus.com
and the client is : Mozilla/4.01 [en] (WinNT; I)
Content Manager [Administrator] 16 December 2005 Bookmark with del.icio.us Post this article to Digg Post this article to reddit Post this article to Facebook Tweet this article  

Recently...

Other Resources