note 26220 added to function.die

From: Date: Tue, 22 Oct 2002 21:46:56 +0000
Subject: note 26220 added to function.die
Groups: php.notes 
Request: Send a blank email to php-notes+get-38437@lists.php.net to get a copy of this message
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(). -- http://www.php.net/manual/en/function.die.php http://master.php.net/manage/user-notes.php?action=edit+26220 http://master.php.net/manage/user-notes.php?action=delete+26220 http://master.php.net/manage/user-notes.php?action=reject+26220

« previous php.notes (#38437) next »