low tech
01-16-2012, 07:12 AM
Hello all
I have changed my site to php pages so I can use php to include header file
but now I'm unsure if I should be using a header or meta tag to indicate the charset
ie which one of these is correct? Should I use a header and a meta tag?
At the moment i'm using version 2 which seems to be ok.
There is no other php involved other than the 'include' at the moment.
1)
<?php
header('Content-Type: text/html; charset=UTF-8');
?>
<!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">
<head>
<!-- Leave this out <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" > -->
</head>
<body>
<?php include_once ('includes/header.php') ?>
OR
2)
<?php
// header('Content-Type: text/html; charset=UTF-8'); //Leave this out
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
</head>
<body>
<?php include_once ('includes/header.php') ?>
help very much appreciated
LT
I have changed my site to php pages so I can use php to include header file
but now I'm unsure if I should be using a header or meta tag to indicate the charset
ie which one of these is correct? Should I use a header and a meta tag?
At the moment i'm using version 2 which seems to be ok.
There is no other php involved other than the 'include' at the moment.
1)
<?php
header('Content-Type: text/html; charset=UTF-8');
?>
<!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">
<head>
<!-- Leave this out <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" > -->
</head>
<body>
<?php include_once ('includes/header.php') ?>
OR
2)
<?php
// header('Content-Type: text/html; charset=UTF-8'); //Leave this out
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
</head>
<body>
<?php include_once ('includes/header.php') ?>
help very much appreciated
LT