Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Problems? Is your data what you think it is?
 
PerlMonks  

(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:

Hi

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?

Thanks

#!/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 = 'mysite.com.au'; 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
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://552900]
Approved by tye
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2014-04-24 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (565 votes), past polls