Why and how to get rid?

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
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Why and how to get rid?

Post by ianhull »

I am using

Code: Select all

include_once("myfile.php");
but when it displays on the page it shows a number 1 after the include

Why does it do this and how would I get rid of it?

Thaks in advance
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

are you sure your not doing

Code: Select all

echo include_once('file.php');
The reason I say that is include_once will return true upon succesful including.. 1 being true, 0 being false.

other than that the only other thing that could do it is file.php is outputting 1
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Post by ianhull »

No I am definatley doing it the way I posted.

I am including a header and a footer.

The header displays the number 1 and the footer does not.

I noticed it a few weeks ago and thought that maybe I had a number 1 on my page but after checking I did not.

Is using include_once different to include?

I need to get rid of this number 1 and if anyone has any suggestions I will be very grateful.

Thanks in advance.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you're emitting it during the script called... :?
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Post by ianhull »

Thanks for the help guys,

I have now found out what it is.

I was using <? echo include_once("myfile.php");

I did not need to have the echo there.

Thanks
Post Reply