You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2003/02/16 05:45:19 UTC

DO NOT REPLY [Bug 17107] New: - Should change sample printenv.pl in cgi-bin directory

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17107>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17107

Should change sample printenv.pl in cgi-bin directory

           Summary: Should change sample printenv.pl in cgi-bin directory
           Product: Apache httpd-2.0
           Version: 2.0.44
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Documentation
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: danielpdunbar@cswebmail.com


A simple change in your sample printenv.pl script you distribute with the 
installation would probably save some people some time.

The problem and the proposed solution are presented below.

Because problems IE 6 has in rendering plain text -
Which you note in your FAQ's at

http://httpd.apache.org/docs/misc/FAQ.html
E: Configuration Questions
16. Why do my files appear correctly in Internet Explorer, but show up as 
source or trigger a save window with Netscape; or, Why doesn't Internet 
Explorer render my text/plain document correctly? 

Your cgi sample printenv.pl will often (most of the time) cause internet 
explorer 6.0 to ask if you want to open or save the file.  Unless you are 
aware of this you may think the problem is with the cgi installation (which is 
actually working fine)

The current contents of printenv.pl are
#!c:/Perl/bin/Perl.exe (particular to the installation)

print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
    $val = $ENV{$var};
    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;
    print "${var}=\"${val}\"\n";
}

If you change text/plain to text/html and
print "${var}=\"${val}\"<br>\n";

html output is generated that will not cause the problem and probably save 
some people some time.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org