RE: page displayed from CGI script
by "Gerhard Teubert" <webmaster(at)steenhansens.com>
|
Date: |
Thu, 30 Aug 2001 11:27:07 -0600 |
To: |
"'Shawn Sass'" <shawn(at)sportsstuff.com>, "'hwg techniques'" <hwg-techniques(at)hwg.org> |
In-Reply-To: |
sportsstuff |
|
todo: View
Thread,
Original
|
|
Hi Shawn,
It could be a missing space after Location: that is causing the problem.
>From the "Perl Cookbook" (O'Reilly & Associates)
19.8. Redirecting to a Different Location
Problem
You need to tell the client's browser to look elsewhere for a page.
Solution
Instead of a normal header, just issue a location redirect and exit.
Don't forget the extra newline at the end of the header.
$url = "http://www.perl.com/CPAN/";
print "Location: $url\n\n";
exit;
this should work.
HTH,
--
Gerhard Teubert
Systems Administrator/Webmaster
Steen Hansen's
http://www.steenhansens.com
-----Original Message-----
From: owner-hwg-techniques(at)hwg.org
[mailto:owner-hwg-techniques(at)hwg.org]On Behalf Of Shawn Sass
Sent: August 30, 2001 10:21 AM
To: hwg techniques
Subject: page displayed from CGI script
Hello list,
Could someone please tell me how to return a page at a certain url through a
cgi script? I've tried
print "Location:http://www.someplace.com/apage/calledthis.htm\n\n";
and
print "http://www.someplace.com/apage/calledthis.htm\n\n";
With no success. I don't know how to tell it to go somewhere.
I've also searched perl.com for some hint of how to accomplish this but had
no success, although I did find some cool pre-made cgi scripts but they do
me no good right now. I really don't want to just print out all the html of
the whole darned page that I want to return from within the script if I
don't have to.
Any suggestions are appreciated,
TIA
_ S h a w n ... .- ... ...
--. .-. .- .--. .... .. -.-.
.- .-. - .. ... -
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA