I'm working on a new web site which will have multiple pages. All using the same header and footer. What I would like to do is come up with some code that allows for the importing of a header and footer section. I've looked at a variety of things, including macros, but would like to use php. Problem is I am only slightly familure with it and am becoming quickly frustrated.
Here's what I have for my index.html:
<!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" xml:lang="en" lang="en">
<head>
<title>Intec Video Systems, Inc.</title>
<link rel="stylesheet" type="text/css"href="global.css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<img src="images/webheader.jpg">
</div>
<!--menu starts here-->
<div id="nav">
<ul class="solidblockmenu">
<li><a href="index.html">Home</a></li>
<li><a href="products.html">Products</a></li>
<li><a href="industries.html">Industries</a></li>
<li><a href="support.html">Support</a></li>
<li><a href="doccenter.html">Document Center</a></li>
<li><a href="ask.html">Ask Intec</a></li>
<li><a href="discount.html">Discount Center</a></li>
</ul><br style="clear: left" />
</div>
<div id="left">
<h4>Articles</h4>
<ul class="left">
<li>
<b>May 2004</b><br>
<a href="">Watch Your Back…</a><br><br>
</li>
<li>
<b>May 2002</b><br>
<a href="">Institute of Transportation Studies, Technology Transfer Program…</a><br><br>
</li>
<li>
<b>May 2002</b><br>
<a href="">Bringing Truck Drivers' Blind Spot Into View…</a><br><br>
</li>
<li>
<b>March 2002</b><br>
<a href="">Food Logistics Magazine (PDF)…</a><br><br>
</li>
<li>
<b>February 2001</b><br>
<a href="">Mine Safety: Video Cameras for Surface Haulers…</a><br><br>
</li>
</ul>
</div>
<div id="content">
<h4>Up comming events</h4>
<hr>
<ul class="content">
<li><strong>Oil Sands - Edmonton, Alberta Canada</strong><br>
September 19th and 20th 2007</li><br>
<li><strong>Waste Con - Reno, NV</strong><br>
October 16th, 17th, and 18th 2007</li>
</ul><br><br><br>
<h4>Intec News</h4>
<hr>
<img src="images/470shxl.jpg" alt="image" width="99" height="120" class="left" />
<br><strong>Intec </strong>introduces the <a href="specs/470shxl.pdf">CVC470SHXL.</a> This camera boasts a 125(H) x 100(V) degree filed of view
and comes with a full 6 year parts and labor warranty. And with a 0.5 lux low light rating it is by far one the best color cameras
available today.</p><br><br><br>
<p><a href="contact.html">Contact</a> your Intec sales represenative today for more information and a price quote.</p><br><br><br>
</div>
</div>
<div id="footer" class="footer"><a href="legal.html">Legal</a> |
<a href="sitemap.html">Site Map</a> |
<a href="faq.html">FAQ</a> |
<a href="contact.html">Contact</a> |
© 2001 - 2007 Intec Video Systems, Inc. All Rights Reserved.
</div>
</body>
</html>
What I'd like to do is pull out the header, nav, and footer divs as they will always be the same and place them in one or two seperate files that I can link to.
I thought it was a simple as creating a new header.html and footer.html and linking them with:
<?PHP
createHTMLHeader()
?>
Problem is it doesn't work and I'm ready to scrap the whole idea and just copy the header/nav/footer code on each page. Will someone please help me? Please!