0

Hi,

I have a html file Top.htm:

<form action="" method="post">
    <fieldset>
        <input id="searchbox" type="text" name="zoekfunctie" value="Zoek..." />
        <input type="submit" name="zoekbutton" value="Zoek" />
    </fieldset>
</form>

I then include this page in my index page (and in many more pages to come):

<div id="top">
        <?php
            include("Top.htm");
        ?>
    </div>

Now the problem is that, for wathever reason there may be, an empty line gets inserted above the html form: Here. However, when I don't include the code, but I just put it in the index page:

<div id="top">
        <form action="" method="post">
            <fieldset>
                <input id="searchbox" type="text" name="zoekfunctie" value="Zoek..." />
                <input type="submit" name="zoekbutton" value="Zoek" />
            </fieldset>
        </form>
    </div>

Than it looks like this: Here

This is the case with every browser. Does anyone has an idea what the problem is, and how to solve it?

Thank you

3
Contributors
11
Replies
12
Views
6 Years
Discussion Span
Last Post by Kligham
Featured Replies
  • 1
    diafol 3,669   6 Years Ago

    Well, seems to me as if you've got some sort of output before the form. I suggest that you create a new txt file and hand type the code again. Save it. Only the form markup should be placed in it - absolutely nothing else. Some text editors save a … Read More

0

Both of these pages look identical to me in chrome. However the code you have posted isn't present in the source code of either, would that be because Im not logged in?

0

I've added new images, now in attachments: notice the extra line marked with a red circle. I hope you now understand what I want to say. The first picture is the one with the include.

Edited by Kligham: n/a

Attachments Include.png 56.46 KB NoInclude.png 53.78 KB
0

From the link you gave this is what I see:


Doesn't look anything like the screenshot you posted!

Attachments Screenshot_2.png 46.57 KB
0

From the link you gave this is what I see:

Doesn't look anything like the screenshot you posted!

My apologies, but the link works apparently only for me (because I was logged in at the site). So again my apologies for that, however the correct images were uploaded in the previous reply and now again.

Attachments Include.png 56.46 KB NoInclude.png 53.78 KB
0

Yes sounds odd. Is your htm file completely empty except for the form itself? It shouldn't have a doctype declaration / body tag or anything else, right?

0

Have a look at the html source code and see what's creeping in.

The source code doesn't show anything weird. So I can't notice any empty line insertion. However I uploaded two pics: one with firebug and one with the chrome element inspector. In chrome it shows a " " between the div and the form element. And in firebug an empty line.

Attachments Chrome.png 668.58 KB Firefox_firebug.png 437.76 KB
0

Yes sounds odd. Is your htm file completely empty except for the form itself? It shouldn't have a doctype declaration / body tag or anything else, right?

Yes, it is completely empty.

1

Well, seems to me as if you've got some sort of output before the form. I suggest that you create a new txt file and hand type the code again. Save it.
Only the form markup should be placed in it - absolutely nothing else. Some text editors save a 'BOM' as a header in the text file. If you're able in your editor, ensure that you 'encode in UTF-8 without BOM'.

I once had display problems due to BOMs being present (usually invisible in the text editor). Drove me absolutely nuts for days.

0

Well, seems to me as if you've got some sort of output before the form. I suggest that you create a new txt file and hand type the code again. Save it.
Only the form markup should be placed in it - absolutely nothing else. Some text editors save a 'BOM' as a header in the text file. If you're able in your editor, ensure that you 'encode in UTF-8 without BOM'.

I once had display problems due to BOMs being present (usually invisible in the text editor). Drove me absolutely nuts for days.

Thank you very much. I rewrote it in notepad and it now works as expected!

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.