Jump to content

[SOLVED] PHP Include inserts unknown charachters


nullpointer

Recommended Posts

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.

 

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.