in reply to Why is the browser displaying a content header?

The workaround I found was to have my &carpout() function not only print a message, but also set a flag also available to my main script. Then before printing a CGI header in the main portion I just check to see if the error flag has been set, and if so, suppress printing an additional header.

I dislike using flags too often, but this is a case where that solution seems to work out ok.


Dave

  • Comment on Re: Why is the browser displaying a content header?

Replies are listed 'Best First'.
Re^2: Why is the browser displaying a content header?
by wfsp (Abbot) on Jul 05, 2004 at 15:55 UTC
    Good idea. I also found that putting the 'regular' output to the browser at the end of the main script minimised the problem. I've seen this recommended for other reasons.
    Also, to exit from &carpout. You can end up with two messages as well as duplicate headers (one message saying 'success' and another saying 'fail')!
    Many thanks, wfsp.