hi, my site has header, footer, and sidebar which repeat on all pages. my goal is to contain the layout, header, footer, sidebar, and content all in separate files, and assemble them with php. problem-- getting pretty urls.
my current structure has only 1 url. each subpage is loaded with a parameter in the url indicating what to load into the content area of the page. for example:
About page url: http://mysite.org/master?contentpage=about
Events page url: http://mysite.org/master?contentpage=events
problem: i want these pages to have prettier urls for sharing. I mean, i want them to have simple urls which make them appear to be static html pages:
http://mysite.org/about
http://mysite.org/events
so question, is there way to achieve that with my current structure? If not, is there a different structure which will achieve simple urls, yet still keep layout in one file, and header, footer, sidebar, and content in other files?
my master page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Include Test</title>
</head>
<body>
<TABLE WIDTH="100%" border=1>
<TR>
<TD class="headercell" colspan="3">
HEADER<br>
<? include "header.php"; ?>
</TD>
</TR>
<TR>
<TD class="leftsidebar">LEFT SIDEBAR
<? include "leftsidebar.php"; ?></TD>
<TD class="bodycell">BODY CONTENT
<br>
<? $pagename=$_GET["contentpage"]; ?>
<? include $pagename.".php"; ?></TD>
<TD>RIGHT SIDE-BAR<br>
<? include "header.php"; ?>
</TD>
</TR>
<TR>
<TD colspan="3">FOOTER</TD>
</TR>
</TABLE>
</body>
</html>
yes, yes, i know tables are satan, you don't have to tell me. please keep replies to the question above.