Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Abort page load and redirect?

by dave0 (Friar)
on Apr 09, 2005 at 19:36 UTC ( #446288=note: print w/replies, xml ) Need Help??


in reply to Abort page load and redirect?

Even assuming you're not printing anything before this, it won't work. You're printing two newlines at the end of your Content-type: header. This creates a blank line in your output, and in HTTP, a blank line indicates that headers are over and content begins on the following line. This should cause your Location: line to appear somewhere in the output document, rather than in the HTTP headers.

You shouldn't even need a Content-Type header with Location, anyway.

And, as said before, CGI.pm's redirect() method is a nicer way to do this.

Replies are listed 'Best First'.
Re^2: Abort page load and redirect?
by ambs (Pilgrim) on Apr 09, 2005 at 19:39 UTC
    Correct. I noticed the two newlines but didn't noticed they were not needed (and incorrect) in this case. dave0++

    Alberto Simões

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2020-11-28 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?