Display CGI environment variables : Environment Variables « CGI « Perl






Display CGI environment variables

    

#!perl
use CGI qw( :standard );

print header;
print <<End_Begin;
<HTML>
   <HEAD>
      <TITLE>Environment Variables...</TITLE>
   </HEAD>
   <BODY>
   <TABLE>
End_Begin

foreach $variable ( sort( keys( %ENV ) ) )
{
   print <<End_Row;
   <TR>
   <TD><STRONG>$variable</STRONG></TD>
   <TD>$ENV{$variable}</TD>
   </TR>
End_Row
}

print <<End_Finish;
   </TABLE>
   </BODY>
</HTML>
End_Finish
# Must include newline after End_Finish!

   
    
    
    
  








Related examples in the same category

1.Viewing Environment Variables in a CGI Script
2.CGI Environment Variables
3.Learn about the server for a CGI request
4.Program to display CGI environment variables.
5.$ENV{'HTTP_USER_AGENT'}, $ENV{'SERVER_PROTOCOL'}, $ENV{'HTTP_HOST'}
6.Get and display the browser type by referencing HTTP_USER_AGENT
7.Server Environment Values
8.CGI request-related environment variables
9.CGI server-related environment variables
10.CGI client-related environment variables
11.HEADER DESCRIPTION
12.Display all values in env
13.Determining the User Agent and Printing the Appropriate Result
14.CGI Environment Variables (Must Be Uppercase)
15.CGI environment variable
16.An example of using QUERY_STRING.