Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Abort page load and redirect?

by dave0 (Friar)
on Apr 09, 2005 at 19:36 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://446288]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (None)
    As of 2024-10-15 18:37 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.