from it's .HTML format to .PHP. Every page on my site has exactly the same code except for
the Content area. This area is an Include (.inc) file containing said content. Is here is an
example of a page:
Code: Select all
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> Author: Richard M. McCord II</title>
<meta name="Author" content="Richard M. McCord II" />
<link rel="stylesheet" type="text/css" href="Code/layout.css" />
<link rel="shortcut icon" href="favicon.ico" />
<script type="text/javascript" src="Code/jquery-1.4.2.js"></script>
<script type="text/javascript" src="Code/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="Code/jquery.lavalamp-1.3.4b2.js"></script>
</head>
<body>
<!-- START PAGE -->
<div id="wrapper">
<!-- START HEADER -->
<div id="Header">
<div id="Header-Left">
<a href="http://richardmccord.com"> <img src="Graphics/logo.png" alt="" img border="0"/></a>
</div>
<img src="Graphics/separator.png" alt="" img border="0"/>
<div id="Header-Right">
My thoughts. My words. My world.
</div>
</div>
<!-- END HEADER -->
<!-- START Menu -->
<!--#include file="MainMenu.inc" -->
<script type="text/javascript">
$(function() {
$('ul#menu').lavaLamp();
});
</script>
<!-- END Menu -->
<!-- START CONTENT -->
<div id="Content">
<div id="Content-BG">
<div id="Content_top">
<div class="title">
<p>Welcome</p>
</div>
</div>
<div id="left">
<!--#include file="Welcome.inc" -->
</div>
<div id="right">
</div>
<div id="Content_bottom"></div>
</div>
</div>
<!-- END CONTENT -->
<!-- START Footer -->
<div id="Footer">
© 1998-2010 Richard M. McCord II
</div>
<!-- END Footer -->
</div>
<!-- END page -->
</body>
</html>
1. The Content area contains a left and right Div. If a particular section requires a Sidebar
menu, then the Right Div houses that file. Otherwise, it's empty.
2. The images and files loaded by the page must have their code updated every time I
go one folder deeper. So: Images/FILENAME becomes: ../Images/FILENAME. And so on.
What I'm trying to do is create one PHP file that will work regardless of how deep I go
in my directory structure so that the only thing I need to keep up with (maintain) is which
Include file is loaded based on the menu choice a visitor makes. I keep hearing that PHP
can accomplish this, and also do so without changing the URL to show the full location of
where the user is. For example, to only show: http://www.richardmccord.com instead of:
http://www.richardmccord.com/Opinions/Opinions.html