]> granicus.if.org Git - apache/blob - docs/cgi-examples/printenv
Adds an example of constructing a type-map file.
[apache] / docs / cgi-examples / printenv
1 #
2
3 # To permit this cgi, replace # on the first line above with the
4 # appropriate #!/path/to/perl shebang, and set this script executable
5 # with chmod 755.
6 #
7 # Note that it is subject to cross site scripting attacks on MS IE
8 # and any other browser which fails to honor RFC2616, so never use
9 # it in a live server environment, it is provided only for testing.
10
11 ##
12 ##  printenv -- demo CGI program which just prints its environment
13 ##
14
15 print "Content-type: text/plain; charset=iso-8859-1\n\n";
16 foreach $var (sort(keys(%ENV))) {
17     $val = $ENV{$var};
18     $val =~ s|\n|\\n|g;
19     $val =~ s|"|\\"|g;
20     print "${var}=\"${val}\"\n";
21 }
22