Gossamer Forum
Home : General : Perl Programming :

print "Location: ....." doesn't print

Quote Reply
print "Location: ....." doesn't print
I got this code:
Code:
if ($c2 eq "Alta Vista")
{
print "Location: http://www.altavista.digital.com/cgi-bin/query?q=$c\n\n";
}
elsif ($c2 eq "Open Directory")
{
print "Location: http://search.dmoz.org/cgi-bin/search?search=$c\n\n";
}
elsif ($c2 eq "Yahoo")
{
print "Location: http://search.yahoo.com/bin/search?p=$c\&n=$c3\n\n";
}
If $c2 is Alta Vista, the the script should redirect to Alta Vista search engine, and search it with $c. When I run the script it doesn't redirect me to Alta Vista, but it prints:
Location: http://www.altavista.digital.com/cgi-bin/query?q=TEST

Why is it?

Quote Reply
Re: print "Location: ....." doesn't print In reply to
It must be preceded by a print "Content-Type: text/html\n\n"; at some point prior. Remove it and it should work.

Dan Smile
Quote Reply
Re: print "Location: ....." doesn't print In reply to
I started getting the same problem when i used IIS headers .

i wil try what you said , and i hope it works .

thanks
Quote Reply
Re: print "Location: ....." doesn't print In reply to
Regarding Malformed HTTP Request Headers in IIS 4.0, there is a hotfix (patch) offered by Microsoft.

Go to Technet: technet.microsoft.com

Then search for IIS Headers (All Words). There are articles as well as a list of patches.

Important: Remember that you will need to re-install the Option Pack after you install any hotfix or patch for NT. DO NOT INSERT THE NT CD-ROM IF ASKED. Just re-boot the server and re-install the Option Pack after the patch has been applied. This piece of information is not noted in any Microsoft white papers, but I have received this information from a trusted source, our technical support people from our vendor.

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: print "Location: ....." doesn't print In reply to
IIS headers are a pain in the ass. Use apache 1.3.9 :p

------------------
Ryan Brown
fpsn.net, Inc.
rbrown@fpsn.net