i know a little php but now i want to learn more. So i start by making a little static website a little dynamic that its easier to maintain. So that i don’t need to change 10 html pages if i want to change something in the header.
So i’m trying to set the variable for the xu-a-compatible mode.
This is a variable?:
But the funny thing is that IE react’s even if i don’t put the print function in the head. Why is that? I mean the first line is just a variable and should not be seen by the browser???
EDIT:
Oh wait. The header is something the server sends. So there is no need to prind it in the html head. I was thinking the metatag way. So:
header() function returns nothing to set to a variable.
Below is the function declaration from the PHP manual, the first word is the return type. Void means it returns nothing. void [B]header[/B] ( string $string [, bool $replace = true [, int $http_response_code ]] )
Now one thing to know, you do not need this header if your code is standards complaints. You only really need it if its not.
IE 8/9 does so by default. It will run your site in standards mode as long as your site is standards compliant, ie., passes the HTML Validation and does not throw IE into quirks mode which it should not. Otherwise, you do not need it.
Call it prevention for the normal user. How many user know what the IE compatible mode is and realize if they maybe switched it on? Always make it luser save…
Then you have nothing to worry about because then IE will use the default which is standards mode.
Besides if the user switch compatibility mode on, in any case then it is on and your header is ignored.
The real purpose of the header is to turn compatibility mode on automatically for sites that need it.
You don’t get it. I talk about luser, for example like my parents. People who hit the comp mode button and did not realize that something is switched on that they don’t even know what it is.
It just force’s IE to use the most up to date rendering engine that it has available.
No I get it. But if they hit that button turning it on for every single site your header is ignored. The header does not do what you think it does. Its a suggestion not an absolute force this type deal.
IE 8/9 both use the most recent rendering engine they have BY DEFAULT. However, if the user wishes to change that they can, and your header is IGNORED. You cannot force the matter. The user can even chose to run in standard mode on websites that need compatibility mode. Again the header is ignored when overridden by the user.