Hrefs in ie creating a blank page

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

User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

If BOMs and session_start really are the problem, then it's not browser related.
A BOM-aware program will not consider the 2 to 4 bytes of the BOM as contents, therefore you haven't seen them in your texteditor.
If the program, like php, is unaware of BOMs it has to use those characters as contents. php sends contents outside a php block as-is to the client. So the first thing php does with a BOMed file is to send the BOM characters to the http client. After the first byte of contents is sent to the client no more http headers can be sent (that's a limitation of the http protocoll), i.e. no header at all for a BOMed file unless an output buffer is defined for php.
freefall
Forum Commoner
Posts: 48
Joined: Sun Jun 18, 2006 3:55 am

Post by freefall »

Ok, then this isnt the problem. I have tested this against many different browsers and it is only one or two specific browsers that the problem occurs in. I would assume there must be some nuances between them, but then maybe I am wrong.

Thankyou to all of you for this information. All I found in textpad was to "change to dos" which might be the setting that was referred to.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

I was experiencing the exact same problem last week. Here is what fixed it:

Code: Select all

header("Content-Type: text/html; charset=UTF-8");
I guess IE didn't like the discrepancy between the metatag and the Content-Type header that was being sent.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

aaronhall wrote:I was experiencing the exact same problem last week. Here is what fixed it:

Code: Select all

header("Content-Type: text/html; charset=UTF-8");
I guess IE didn't like the discrepancy between the metatag and the Content-Type header that was being sent.
Considering the meta tag is inside the encoded data, it can be quite difficult to be sure that it's correct in guessing the encoding. At any rate, the character encoding should be in the headers anyways.
Post Reply