note 84291 added to function.header

From: Date: Tue, 08 Jul 2008 04:14:02 +0000
Subject: note 84291 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-141257@lists.php.net to get a copy of this message
heres a fix for my last post- IE ignores custom error pages that are less than 512 (or from what i've read 1024) bytes. the past post broke with the release of firefox 3.0 which treats any -- inside of a html comment as a end of comment and not just --> like in the past here the fix just place this before any output on your custom error page--- and be sure that your custom error page includes proper html tags (it must have a </body> for this specific example to work) <?php // set your custom error header --- example --- header('HTTP/1.1 503 Service Unavailable'); function padding($html){ return ($padding=1024-ob_get_length()) > 0 ? str_replace('</body>','<!--'. ($padding>8?str_repeat(' ',$padding-8) :null ).'-->'."\n".'</body>',$html) : $html; } ob_start('padding'); ?> ---- Server IP: 209.41.74.194 Probable Submitter: 75.24.28.111 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/84291 Del: integrated -- https://master.php.net/note/delete/84291/integrated Del: useless -- https://master.php.net/note/delete/84291/useless Del: bad code -- https://master.php.net/note/delete/84291/bad+code Del: spam -- https://master.php.net/note/delete/84291/spam Del: non-english -- https://master.php.net/note/delete/84291/non-english Del: in docs -- https://master.php.net/note/delete/84291/in+docs Del: other reasons-- https://master.php.net/note/delete/84291 Reject -- https://master.php.net/note/reject/84291 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#141257) next »