Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
November 12, 2006, 1:39 pm
rate this thread
page. XMLHttpRequestObject.responseText as received from the PHP script
begins with 2 extra newline characters (\n\nMyString):
$var1 = 1;
$var2 = 2;
$var3 = 3;
If I manually write the contents of myFile.php into the script, there
are no extra newlines in responseText.
Am I missing something?
Re: extra newlines in output text added by PHP file include
There's probably one at the start or end of DB.php.
There's probably one at the start or end of this one too, which would make two
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 :: firstname.lastname@example.org :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
- » Dynamically managing certain document aspects (e.g. title)
- — Previous thread in » PHP Scripting Forum