Weird problem

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
danic
Forum Newbie
Posts: 2
Joined: Mon Feb 14, 2005 4:22 am

Weird problem

Post by danic »

First of all, hello everybody!

I have a weird problem.
My website is hosted on an Apache server. It is entirely written in PHP+MySql.
However, I have a problem. I am writing a RSS feed for my site. Whatever I do, I have a 0x0A character at the begining of the output.
However, when I moved the rss generator in a subdirectory, everything worked fine.
Another example: On my forums: http://www.publionline.ro/forum/index.p ... =post&id=7 (sorry about the link). When you click an attached image, the output is generated again with a extra 0x0A character at the beginning. This prevents the image from loading. I've downloaded the output from that location, deleted the extra character and everything worked fine. The IPB forum was not modified in any way (no mods installed). I also mention that the images stored on disk (the uploaded images) are ok. Also, this problem appeared two weeks ago. The hosting company denies that this might be a miscobfiguration of their servers.

Does anyone know what could be the cause of this problem?
Please help me. Any ideas are welcome.

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 »

possible sources:
  • there's a line break at the beginning of the script file handling it, it probably didn't show its ugly head earlier due to some configuration on the server
  • the server's header results have changed and are now outputting three carriage returns instead of two to terminate the header section. Check all your calls to header() to make sure they do not contain any line break characters.
danic
Forum Newbie
Posts: 2
Joined: Mon Feb 14, 2005 4:22 am

Post by danic »

Indeed, @feyd.
Problem solved. I've added an extra ob_clean() before the print statement and everything seems to work just fine.

Can someone explain this to me?

Thanks!
Post Reply