Whitespace appearing before main site content

Greetings,

I’m encountering a strange issue I’m finding difficult to resolve.

I’m using a controller script (index.php) with a template (authors.html.php) to display some content. However when I load the controller and it calls the template I’m getting a block of whitespace appearing before the main site content.

Googling the problem leads me to solutions involving ensuring that the files are encoded in UTF8 without BOM. I have done this with both controller script and template using firstly Notepad++ (my editor of choice) then Sublime Text, but still doesn’t resolve the problem. I have tested in Google Chrome and IE with same results.

While testing in IE, I changed the page encoding to Auto-Select (right-click > Encoding >Auto-select). This caused the encoding to change to Western European AND the BOM characters appeared in the whitespace area. Now, I’ve gone back and made sure that the pages are definitely saved without BOM again and that my charset is UTF-8 in the head of my template file and it all seems as it should be.

Can anyone help shed some light on why I continue to get these BOM characters appearing despite my efforts - it’s driving me nuts!! :confused:

Thanks in advance.

Please show your codes.

Hi orbicx. Welcome to the forums. :slight_smile:

As solidcodes says, link us to your site if possible. It may be something else causing the space, but we can’t know until we have a look. :slight_smile:

Reading this other thread would likely help you out too. Make sure any files that contain PURE PHP code, do not have a closing PHP tag.