nullpointer Posted August 8, 2008 Share Posted August 8, 2008 I have index file (index.php) and another file brands.php The content of brands.php is just three lines below <?php require_once 'index.php' ; ?> My expectation is brands.php should be exactly like index.php. But php include is inserting extra characters on the top This is the character i got from firefox :  IE does not show any thing. my .htaccess file is RewriteEngine on RewriteRule ^(.*)\.html$ $1.php [L] php version is PHP 5.2.6 (cli) (built: May 2 2008 18:02:07) Copyright © 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright © 1998-2008 Zend Technologies I tested over godaddy as well. Those files are live in jdmhub.com and jdmhub.com/brands.html I edited these files with Front Page .. did it mess up the file encoding ? please help. Thanks ----------------------------------- SOLVED ----------------------------------- I solved it. It was Front Page messing up the encoding. I copied the text and pasted it in textpad and saved with same name. It solved the problem. Quote Link to comment https://forums.phpfreaks.com/topic/118758-solved-php-include-inserts-unknown-charachters/ Share on other sites More sharing options...
wildteen88 Posted August 8, 2008 Share Posted August 8, 2008 The characters  usually means PHP is outputting the BOM, this only happens when files are saved as UTF-8 To fix this you should save you files as "UTF8 without BOM" (this should be a setting in your text editor/save dialog). Or save the file as ASCII instead. Quote Link to comment https://forums.phpfreaks.com/topic/118758-solved-php-include-inserts-unknown-charachters/#findComment-611453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.