Problem with include file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tiendan
Forum Newbie
Posts: 9
Joined: Tue Apr 01, 2003 11:39 pm
Location: Vn

Problem with include file

Post by tiendan »

Hi everybody. I have a problem with include file. Please help me.

I have a file file logo.phtml with content :
------------------------------
<table border='1'>
<tr>
<td>
Content here
</td>
</tr>
</table>
------------------------------

And I have index.php file :
-------------------------------
<?
include('logo.phtml');
........................
...........................
?>

--------------------------------


When I include logo.phtml into index.php, file index.php will have a blank line at the first. And everytime and everywhere when I include file, the blank line also appear> I don't know fix it. Help me.

Thank you
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I take it you have made sure that there are no blank lines at the top of logo.phtml

Mac
tiendan
Forum Newbie
Posts: 9
Joined: Tue Apr 01, 2003 11:39 pm
Location: Vn

Post by tiendan »

Yes, no blank line at logo.phtml.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

wrap in html

Post by phpScott »

It could be that you are not wraping your first file around <html> </html> tags and the brower is by default leaving room.

Try includint you file down in the hmtl code some where.

Code: Select all

<html>
<head><tiitle>Your Page</title>
<head>
<body>
<?php
include('yourFileHere.phtml')
?>
</body>
</html>
phpScott
Post Reply