This is probably something very simple that I am missing but for the life of me I can't figure it out. System is Slackware Linux 10 with the included apache and php. I am using CSS to create the layouts for the web pages which include a horizontal menu bar part way down the page. If the menu is coded on the web page itself it works. Also, menu content is in html. What I wanted to do is make the menu content its own "template" and use code to insert that into each web page. Since I will be using php for other items I thought to use it here. So, I thought that using an include statement would do what I want.
First, php does show the test page when I access it through a browser. So I know it is running. Here is part of the code for the index.htm web page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>CACCThome</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta content="children, abuse, child abuse" name="keywords" />
<link href="css/sitestyle.css" type="text/css" rel="stylesheet" />
<script type="text/javascript"><!--//--><![CDATA[//><!--
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
//--><!]]></script>
</head>
<body>
<div style="text-align: center;">
<div class="content">
<div class="header">
<p>
<img alt="" src="images/cacctnewlogo.gif" border="0" />
</p>
<blockquote class="sitestyle">
402 North Main, Belton Texas 76513<br />
(254) 939-2946
</blockquote>
</div>
Today's date: <?php print( Date(" l F d, Y")); ?>
<?php
include("./php/menu.html");
?>
<div class="maincontent">
<div class="title">Welcome to the Children's Advocacy Center of Central Texas' web site!
</div><br />
Everyday we welcome
A couple of notes on the above. index.htm is in the root directory. The menu.html (has been named .php and .txt to try different things) is in the subdirectory php. The include does not show up at all. I inserted the Todays date line just to see if that worked. It did not. The words Todays date show but nothing else.
And here is part of the menu code I am wanting to template:
<hr />
<ul id="nav">
<li class="first">
<div><a href="index.htm">Home</a><div>
</li>
<li>
<div><a href="index.htm">About Us</a></div>
<ul>
<li><a href="blank.html">History</a></li>
<li><a href="mission.html">Mission</a></li>
<li><a href="staff.html">Staff</a></li>
<li><a href="executive.html">Executive</a></li>
<li><a href="board.html">Board</a></li>
</ul>
</li>
<li>
<div><a href="index.htm">Education</a></div>
<ul>
<li><a href="reportabuse.html">How to Report Abuse</a></li>
<li><a href="index.htm">Community Resources</a></li>
<li><a href="online.html">Online Resources</a></li>
<li><a href="internet.html">Internet Safety</a></li>
<li><a href="faq.html">FAQs</a></li>
</ul>
</li>
<li>
The menu code I had in as php code but thought well it's not executing anything here so I took the php out. So, nothing I have done makes this work. Basically this same menu appears on every page so I wanted to "template" it to make changes to it easier. And as I said, test.php does show up so I know php is running.
Any help would be appreciated;
tk