You are here: Include Content pages in Master page « PHP Language « IT news, forums, messages
Include Content pages in Master page

Posted by McKirahan on 01/12/07 05:36

I am looking for feedback on an approach to using PHP.

Below is a stripped down version of a Home page: "index.php".

The content of the site is displayed in the middle of the page and
is "included" via "Page1.htm", "Page2.htm", or "Page3.htm".

The page to be "included" is specified via the QueryString
which is specified in the navigational hyper links;
for example, "index.php?Page1".


<html>
<head>
<title><?php echo $_SERVER["PHP_SELF"] ?></title>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" width="100%"
height="100%">
<tr>
<td bgcolor="green" colspan="3">&nbsp;</td>
</tr>
<tr>
<td bgcolor="red" width="5"%>&nbsp;</td>
<td bgcolor="white" width="90%">
<p align="center">
<a href="index.php?Page1">Page 1</a> |
<a href="index.php?Page2">Page 1</a> |
<a href="index.php?Page3">Page 3</a>
<hr>
</p>
<!-- Content Below -->
<?php
$QS = $_SERVER["QUERY_STRING"];
echo $QS;
if ($QS == "Page1") include "Page1.htm";
elseif ($QS == "Page2") include "Page2.htm";
elseif ($QS == "Page3") include "Page3.htm";
else include "Page1.htm";
?>
<!-- Content Above -->
<br><br>
</td>
<td bgcolor="blue" width="5%">&nbsp;</td>
</tr>
<tr>
<td bgcolor="yellow" colspan="3">&nbsp;</td>
</tr>
</table>
</body>
</html>

One advantage I see to this approach is that the "content" pages
are isolated from the "master" page and can be easily maintained.

One disadvantage I see to this approach is that search engines
would not be able to catalog the site beyond the Home page.

Are there other disadvantages (or other considerations) that I don't see?

Thanks in advance.

P.S. I am new to PHP but have worked with ASP for years.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация