Reputation: 8209
I copied one of the html pages in a project and just changed the extension from html to php. The rendering is identical in all browsers but IE. It seems that IE treats the pages differently based on the extension.
I checked the HTTP headers and they are the same for both pages. Did anyone have the same problem?
Upvotes: 0
Views: 282
Reputation: 39015
Just add:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
at the top of your source file
Upvotes: 0
Reputation: 2411
Rather than browsing the pages via HTTP to a web server, try File->Open. That will at least eliminate or incriminate the web server.
Upvotes: 0
Reputation: 75704
I would start by verifying the responses are the same. Try the following, in order:
wget -S
, for example) and compare it to the response of the html page.header()
) until you find the one that is responsible for the change.I really doubt it's the extension, it must be something in the headers.
Upvotes: 2
Reputation: 1755
What versions of the browsers are you using? Older versions of IE produced some non-conforming output, especially connected to CSS. (are you using CSS?)
It is quite common for some elements to be a little different in different browsers. It is what makes web coding fun (?!) and a challenge.
And, as Darryl asked, what exactly is different?
Upvotes: 0
Reputation: 29953
PHP isn't configured to auto append or prepend anything to your file, is it? Long shot, but worth checking...
(see the Data Handling section of this page)
Upvotes: 2
Reputation: 144967
Make sure you aren't in Quirks mode. Most often this has been caused for my by having text before the <doctype>
.
Upvotes: 3