Including HTML Header?

I could use some help cleaning up my web pages by trying to put the HTML Page Header in a PHP Include.

The problem - as I see it - is that the <header> has different content in it for every page?!

Also, I’m not sure if you can include the very first part of a web page (i.e. <html>) in an include?!

Here is the area I’m trying to work with…


<head>
	<!-- HTML Metadata -->
	<title>[B][COLOR="#00F"]Comment on an Article[/COLOR][/B]</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="description"
				content="[B][COLOR="#00F"]Some unique description for the page.[/COLOR][/B]" />
	<meta name="keywords"
				content="[B][COLOR="#00F"]Some unique keywords for the page.[/COLOR][/B]" />

	<!-- Page Stylesheets -->
	<!-- [B][COLOR="#00F"]These Stylesheets may or may not vary from page to page?![/COLOR][/B] -->
	<link type="text/css" rel="stylesheet" href="css/main.css" />
	<link type="text/css" rel="stylesheet" href="css/dropdown.css" />
	<link type="text/css" rel="stylesheet" href="css/components.css" />
	<link type="text/css" rel="stylesheet" href="css/add_comment.css" />
</head>

Any ideas?

Thanks,

Debbie

You can certainly do this.

Not a problem.

What you need to do is set up variables in your php page (before the php include) containing the keywords, title of the page, and the description. Then the include file will place the variables in the correct locations in the HTML page.

Also not a problem.

<head>
<!-- HTML Metadata –>
<title><?php echo $title; ?></title>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<meta name=“description”
content=“<?php echo $meta; ?>” />
<meta name=“keywords”
content=“<?php echo $keywords; ?>.” />

&lt;!-- Page Stylesheets --&gt;
&lt;!-- These Stylesheets may or may not vary from page to page?! --&gt;

[COLOR=“#FF0000”]<?php

if($_SERVER[‘PHP_SELF’]==‘index.php’) {

?>[/COLOR]

&lt;link type="text/css" rel="stylesheet" href="css/main.css" /&gt;
&lt;link type="text/css" rel="stylesheet" href="css/dropdown.css" /&gt;
&lt;link type="text/css" rel="stylesheet" href="css/components.css" /&gt;
&lt;link type="text/css" rel="stylesheet" href="css/add_comment.css" /&gt;

<?php } ?>

</head>

include(“header.php”);