php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6652 include() require() add trailing CRLF
Submitted: 2000-09-10 18:11 UTC Modified: 2001-04-10 09:31 UTC
From: kevin at henrikson dot com Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.4 OS: RedHat Linux 6.2
Private report: No CVE-ID: None
 [2000-09-10 18:11 UTC] kevin at henrikson dot com
When using include() or require imbeded in HTML a trailing new line is added. Example:

START<?include('/file.inc');?>END

Will produce:

START<<File contents>>
END

The file can contain any number of characters.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-16 18:25 UTC] stas@php.net
Cannot reproduce that on my system. Could you publish your file.inc?
 [2000-09-17 02:14 UTC] kevin at henrikson dot com
Start include.php
START<?include('/web/file.inc')?>END
End include.php

Start file.inc:
This is some text
End file.inc

Niether file has a trailing new line.  Remember to do a view source to see this because the browser will not render a new line.  
 [2001-01-12 21:29 UTC] cynic@php.net
have you by any chance updated your PHP since 4.0.2? does it still happen?
 [2001-01-13 12:52 UTC] kevin at henrikson dot com
Yes,  We are now running 4.0.4  It has the same result.


-Kevin
 [2001-01-13 13:11 UTC] cynic@php.net
hm... unable to reproduce it on RH6.2 with 4.0.4
does it happen only with include() and require()? does the appended newline appear after the include()d / requre()d text at the end of the whole resulting document?
what's the auto_prepend_file directive set to? 
 [2001-01-13 17:31 UTC] cynic@php.net
sorry, it should have been 

... after the include()d / requre()d text OR at the end of ...
 [2001-03-08 20:14 UTC] sniper@php.net
I can not reproduce this one either. 
Are you sure that the include.php has got
only one line in it which isn't terminated with newline?

--Jani

 [2001-04-10 09:31 UTC] sniper@php.net
No feedback. If this happens with soon to be released PHP 4.0.5 too, reopen this bug report.

--Jani

 [2002-08-15 23:24 UTC] hoanghp2000 at yahoo dot com
I used IIS 5.0, PHP 4.0.5
When I used include() function with charset=utf-8 
The result page have some character before tag. If you used IE 5.5 SP2 those characters did not view on the screen. If you used older IE you will see the block on the screen.
How do you solve this problem ?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC