0

Hi,

I have seen a lot of people have been having a similar problem to this, but I have not found a solution and so daniweb is the best place to go!

Basically, whenever I use:

<?php
include_once "Filename.php";
?>

which I often do for the header, navigation and footer of a website it works fine. But when I upload the website, these sections have a margin-top of around 24px; I can simply fix the problem by adding -24px to the css to counteract the problem, however, this makes content appear in the wrong place when testing it offline.

Can anyone shed some light on this problem?

Many Thanks

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by ptemedia
1

Check if you have sent to buffer any of new line space, ex: \r or/and \n.
Be sure, before you open or after close PHP tag, you have no left any space or data you don't need, like:

data wrong place
<?php // code ?>
data wrong place

If you are using a free hosting, it may be the place of some automatic insertion scripts to trace/stats/advertising.

Edited by eXpertPHP: n/a

0

Check if you have sent to buffer any of new line space, ex: \r or/and \n.
Be sure, before you open or after close PHP tag, you have no left any space or data you don't need, like:

data wrong place
<?php // code ?>
data wrong place

If you are using a free hosting, it may be the place of some automatic insertion scripts to trace/stats/advertising.

Thankyou!

The problem was that the code on the page to be included started on line 2 and was indented. Removing that fixed it perfectly, cheers

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.