I'm trying to display environment variables in my browser (IE):
Here's the html:
<head>
<title>variable test</title>
</head>
<body bgcolor=white>
<center>
<a href=cgi-bin/env.pl>Environment Variables Example</a>
</center>
</body>
Here's the perl:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<HEAD><TITLE>Environment VARIABLES</TITLE></HEAD><br>";
print "<BODY><H1>Some Environment variables</H1><br>";
print "<br>";
print "<HR><PRE>\n";
print "Your current IP address is: $ENV{'REMOTE_ADDR'}<BR>\n";
print "Your Browser is: $ENV{'HTTP_USER_AGENT'}<BR>\n";
print "The page you were just on is: $ENV{'HTTP_REFERER'}<BR>\n";
print "The server sending you this page is: $ENV{'SERVER_NAME'}<BR>\n";
print "</PRE></BODY>\n";
Here's what is displayed in my browser:
#!/usr/bin/perl print "Content-type: text/html\n\n"; print "
"; print "
Some Environment variables
"; print "
"; print "
--------------------------------------------------------------------------------
\n";
print "Your current IP address is: $ENV{'REMOTE_ADDR'}\n";
print "Your Browser is: $ENV{'HTTP_USER_AGENT'}\n";
print "The page you were just on is: $ENV{'HTTP_REFERER'}\n";
print "The server sending you this page is: $ENV{'SERVER_NAME'}\n";
print "
\n";
I'm not sure why it's doing this. Can anyone help? Thanks.
Here's the html:
<head>
<title>variable test</title>
</head>
<body bgcolor=white>
<center>
<a href=cgi-bin/env.pl>Environment Variables Example</a>
</center>
</body>
Here's the perl:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<HEAD><TITLE>Environment VARIABLES</TITLE></HEAD><br>";
print "<BODY><H1>Some Environment variables</H1><br>";
print "<br>";
print "<HR><PRE>\n";
print "Your current IP address is: $ENV{'REMOTE_ADDR'}<BR>\n";
print "Your Browser is: $ENV{'HTTP_USER_AGENT'}<BR>\n";
print "The page you were just on is: $ENV{'HTTP_REFERER'}<BR>\n";
print "The server sending you this page is: $ENV{'SERVER_NAME'}<BR>\n";
print "</PRE></BODY>\n";
Here's what is displayed in my browser:
#!/usr/bin/perl print "Content-type: text/html\n\n"; print "
"; print "
Some Environment variables
"; print "
"; print "
--------------------------------------------------------------------------------
\n";
print "Your current IP address is: $ENV{'REMOTE_ADDR'}\n";
print "Your Browser is: $ENV{'HTTP_USER_AGENT'}\n";
print "The page you were just on is: $ENV{'HTTP_REFERER'}\n";
print "The server sending you this page is: $ENV{'SERVER_NAME'}\n";
print "
\n";
I'm not sure why it's doing this. Can anyone help? Thanks.