note 42728 added to function.include

From: Date: Thu, 27 May 2004 10:31:56 +0000
Subject: note 42728 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-70171@lists.php.net to get a copy of this message
A gotcha that threw me is that includes are treated as HTML unless told otherwise (hence the <?php .. ?> requirement.) A consequence is that blank lines at the beginning and end are parsed as HTML and output. This is normally probably OK unless you are calling header("location: ...) in your calling code in which case PHP will throw an error as follows: error_handler: errno=2 errstr=Cannot modify header information - headers already sent by (output started at includefile:21) sourcefile.php errline=38 Remove the blank lines and you'll be OK! ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42728 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42728&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42728&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#70171) next »