Perl

Mark Ellis mark.ellis at rpl.richmond.bc.ca
Mon Dec 22 20:02:31 EST 1997


Steve Thomas wrote:

>David, I assume you have somewhere in your script a line that prints the
>http content-type declaration? Normally, this is followed by a blank
>line, which signifies the end of http declarations and the beginning of
>content. Since the Location command is an instruction to the browser (i.e.
>an http instruction) it needs to immediately follow the Content-type,
>without a blank line, e.g.:
>
>>
>>       {
>>       if ($input{'subject'} eq "art")
>>               {
>                print "Content-type: text/html\n";
>>               print "Location: http://salve4.salve.edu/sub-arts.html\n\n";
>>               }
>>       }
>>
>
>I think you'll find that fixes your problem.
>

For this application, it shouldn't be necessary to include the content-type
at all since you're redirecting to another URL not following the header
with the specified content.  The location line followed by two newlines
should do it. (It worked for me)

----------------------------------------------------------------------------
Mark Ellis
Network Support Analyst                 Phone: (604) 231-6410
Richmond Public Library                 Email: mark.ellis at rpl.richmond.bc.ca
Richmond, British Columbia
----------------------------------------------------------------------------




More information about the Web4lib mailing list