Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

(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' }'

Comment on (OT) Windows XP browser doesn't seem to recognise $ENV{ 'HTTP_HOST' }
Select or Download Code
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2015-11-25 07:16 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (672 votes), past polls