In article
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Brett W. McCoy) wrote:
> On Fri, 12 Oct 2001, Carl Franks wrote:
> > if (condition) {
> > print "Location:page.html\n\n";
> > } else {
> > print "Content-type: text/html\n\n";
> > print "...html...";
> > }
> > }
> BTW, for a Location hea
I know, I just cut the code right back for clarity before posting it (maybe
silly thing to do?)
Thanks
carl
> if (condition) {
> print "Location:page.html\n\n";
> } else {
> print "Content-type: text/html\n\n";
> print "...html...";
> }
> }
BTW, for a Location header, you should an absolu
On Fri, 12 Oct 2001, Carl Franks wrote:
> if (condition) {
> print "Location:page.html\n\n";
> } else {
> print "Content-type: text/html\n\n";
> print "...html...";
> }
> }
BTW, for a Location header, you should an absolute URL and not a relative
URL, even if it's on the same server as the
Thanks everyone who replied,
What I was doing was quite simple, and I know what was going wrong.
I WAS using...
print "Content-type: text/html\n\n";
if (condition) {
print "Location:page.html\n\n";
} else {
print "...html...";
}
}
Whereas I SHOULD have used...
if (condition) {
print "Loca
to do so I use CGI.pm module,
$query = new CGI;
...
don't insert header before the redirection!!!
In such a case it don't work.
$query->redirect("THE URL");
that is't and is work fine.
Denis
-Original Message-
From: Grierson, Garry (UK07) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, Oct
> From: [EMAIL PROTECTED] (Randal L. Schwartz)
> Organization: Stonehenge Consulting Services; Portland, Oregon, USA
> Date: 10 Oct 2001 15:32:01 -0700
> To: [EMAIL PROTECTED], [EMAIL PROTECTED] (Michael Kelly)
> Subject: Re: Browser Redirection
>
>>>>>>
> "Michael" == Michael Kelly <[EMAIL PROTECTED]> writes:
Carl> print "Content-type:text/html\n\n";
>>
>> needs a space to be compliant. "Content-type: text/html"
Michael> Not exactly. Carl is already printing the content-type,
Michael> complete with two newlines, which ends the headers. [.
In article
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Brett W. McCoy) wrote:
> On Wed, 10 Oct 2001, Michael Kelly wrote:
>
> > print "Content-type: text/html\n";
> > print "Location: http://www.mysite.com/page.html\n\n";;
> This is incorrect also, because the "Location: ...\n\n" is an http heade
On Wed, 10 Oct 2001, Michael Kelly wrote:
> print "Content-type: text/html\n";
> print "Location: http://www.mysite.com/page.html\n\n";;
This is incorrect also, because the "Location: ...\n\n" is an http header
and should not be used after a Content-type header is sent to the browser.
It should
> From: [EMAIL PROTECTED] (Randal L. Schwartz)
> Organization: Stonehenge Consulting Services; Portland, Oregon, USA
> Date: 10 Oct 2001 09:06:34 -0700
> To: [EMAIL PROTECTED]
> Subject: Re: Browser Redirection
>
>>>>>> "Carl" == Carl Franks <[EM
> "Carl" == Carl Franks <[EMAIL PROTECTED]> writes:
Carl> Hi
Carl> I'm having trouble using perl to redirect a browser to another page.
Carl> If the script has the line
Carl> print "Content-type:text/html\n\n";
needs a space to be compliant. "Content-type: text/html"
Carl> print "Location
When you use
print "Location: http://www.mysite.com/page.html\n\n";;
to redirect you should never print "Content-type: text/html\n\n"; before
it. When printing "Content-type: text/html\n\n" you tell the receiving
browser that anything after that line is text/html.
The line "Location http://www.m
12 matches
Mail list logo