Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.