note 26220 deleted from function.die by didou
| From: | didou@php.net | Date: | Sun, 18 May 2003 10:59:33 +0000 |
| Subject: | note 26220 deleted from function.die by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48515@lists.php.net to get a copy of this message | ||
Note Submitter: fatzillaATnoDOTearthDOTspamDOTlinkDOTnet
----
So when you use die() after an open <html> tag, don't forget to use die like this :
die("blabla\n\n</body>\n\n</html>") ; This will close the body and html tags.
---
This is in error. There are many situations in which closing the body and html tags are not
desirable, or in some cases even outright incorrect - a frameset is an easy example. Moreover,
since what this code seems to be attempting to do is to after-the-fact bork in well-formedness, you
should realize that this will *not* lead to well formed documents; if there were other open tags,
which cannot reasonably be hedged against, they will remain open. Tables, iframes, and certain
other tags can have extremely bad results if left unclosed.
The appropriate course of action is to make any calls to die() BEFORE any rendering is sent.
Buffered output may be an answer; I do not know offhand if the output buffer is flushed on die().