Search code examples
phphtmlquirks-mode

no quirks mode on php pages?


My site is all php pages, since it's all database stuff. However, I'm having trouble putting the pages into no quirks mode... I did the regular thing:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

and this doesn't work. If I create an html page with the same code, of course it works.

So this leads me to believe that I can only to off quirks mode in html pages? Maybe this is a stupid question, and I don't need to turn off quirks mode in php page?.. Please help, <form> keeps breaking a line, and I've tried multiple fixes, but I'm thinking it has to do with the site being in quirks mode.


Solution

  • Your PHP script may be outputting some Content-Type header that tells the browser the page is some other formatting than the doctype specifies. I'm not sure how the browser is supposed to resolve such a conflict. I'm also not sure how you've got PHP set up to output the Content-Type headers, but if you look in the PHP manual for headers, you'll probably be on the right track. The setting may also be in your web server config.