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"> </td>
</tr>
<tr>
<td bgcolor="red" width="5"%> </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%"> </td>
</tr>
<tr>
<td bgcolor="yellow" colspan="3"> </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.
[Back to original message]
|