Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

(OT) Windows XP browser doesn't seem to recognise $ENV{ 'HTTP_HOST' }

by jonnyfolk (Vicar)
on May 31, 2006 at 18:43 UTC ( #552900=perlquestion: print w/replies, xml ) Need Help??
jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:


I'm using the following script (pared down) to open up a framed window in my browser.

When I view it on IE for Mac OS 9.1 all is well. However on Win XP IE I get two 'page not found' s & Firefox give blank screens. I have also tried with my $host = $ENV{ 'SERVER_NAME' }; to no avail!

When I uncomment the named host however both browsers show the pages ok.

I'm trying to make this script generic over several sites so I don't particularly want to name the host every time. Could anyone tell me what is going wrong and how I might get round this?


#!/usr/bin/perl -w use strict; use CGI qw/:standard :netscape/; print "Content-type: text/html\n\n"; my $root = $ENV{ 'DOCUMENT_ROOT' }; my $host = $ENV{ 'HTTP_HOST' }; #$host = ''; my $page = 'index.html'; print title('Title'), frameset({-rows=>'40%,60%'}, frame({-name=>'left',-src=>"http://www.$host/start.html"}), frame({-name=>'right',-src=>"http://www.$host/$page"}) );

2006-06-03 Retitled by g0n, as per Monastery guidelines
Original title: 'Windows XP browser doesn't seem to recognise $ENV{ 'HTTP_HOST' }'

Replies are listed 'Best First'.
Re: (OT) Windows XP browser doesn't seem to recognise $ENV{ 'HTTP_HOST' }
by Joost (Canon) on May 31, 2006 at 19:03 UTC
      That fixed it - thanks Joost

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://552900]
Approved by tye
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2018-06-23 23:40 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.