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