[pmwiki-users] Failing mailform use

Patrick R. Michaud pmichaud at pobox.com
Mon Apr 11 12:20:42 CDT 2005


On Mon, Apr 11, 2005 at 10:02:22AM -0700, John W Morris wrote:
>    My glitch... when I copied and pasted the script into a php editor I got a
>    blank line at the end of the script and that caused all the trouble.
>     
>    Is this an overly sensitive parser issue?   One blank line before or after
>    the opening or closing should not cause problems I would think or is there
>    some other reason that it has to be this way.

(Already answered John privately, but forwarding the answer to the
list also...)

This is just the way PHP is designed -- PHP is designed to be embedded 
within HTML pages, so that anything that appears outside of a <?php ... ?>
block is automatically sent to the browser -- this includes things in
files added via include_once().

Unfortunately, once some output has been sent to the browser, it's no
longer possible for PHP (or PmWiki) to set or change the HTTP headers 
for the page, which is what generates the warning message.

All of the workarounds for this that I've been able to come up with
have undesirable side-effects or make other problems more acute.  

Actually, now that I think about it, it *might* be possible for me to
have PmWiki detect which this has occurred and give a more helpful
error message, rather than leave it to PHP to detect and give the
somewhat unhelpful message.  I'll have to think about this a bit...

Pm



More information about the pmwiki-users mailing list