|
Posted by Andy Hassall on 11/12/06 18:17
On 12 Nov 2006 05:39:25 -0800, abrtlt@yahoo.com wrote:
>I have a simple PHP script that outputs a string requested by an Ajax
>page. XMLHttpRequestObject.responseText as received from the PHP script
>begins with 2 extra newline characters (\n\nMyString):
>
><?php
>require_once('DB.php');
There's probably one at the start or end of DB.php.
>require_once('../myDir/myFile.php');
There's probably one at the start or end of this one too, which would make two
newlines.
If the included PHP file ends in a new line immediately after the closing ?>,
then it won't be sent. This is recommended else tools such as diff get upset.
If there's an additional blank line after that, then that will get sent.
Also be careful with the difference between Windows line endings and UNIX line
endings, as that can confuse the issue.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|