|
Posted by OmegaJunior on 01/12/07 06:58
On Fri, 12 Jan 2007 06:36:51 +0100, McKirahan <News@McKirahan.com> wrote=
:
> 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=3D"0" cellspacing=3D"0" cellpadding=3D"0" width=3D"100%"=
> height=3D"100%">
> <tr>
> <td bgcolor=3D"green" colspan=3D"3"> </td>
> </tr>
> <tr>
> <td bgcolor=3D"red" width=3D"5"%> </td>
> <td bgcolor=3D"white" width=3D"90%">
> <p align=3D"center">
> <a href=3D"index.php?Page1">Page 1</a> |
> <a href=3D"index.php?Page2">Page 1</a> |
> <a href=3D"index.php?Page3">Page 3</a>
> <hr>
> </p>
> <!-- Content Below -->
> <?php
> $QS =3D $_SERVER["QUERY_STRING"];
> echo $QS;
> if ($QS =3D=3D "Page1") include "Page1.htm";
> elseif ($QS =3D=3D "Page2") include "Page2.htm";
> elseif ($QS =3D=3D "Page3") include "Page3.htm";
> else include "Page1.htm";
> ?>
> <!-- Content Above -->
> <br><br>
> </td>
> <td bgcolor=3D"blue" width=3D"5%"> </td>
> </tr>
> <tr>
> <td bgcolor=3D"yellow" colspan=3D"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 s=
ee?
>
> Thanks in advance.
>
> P.S. I am new to PHP but have worked with ASP for years.
>
>
1) Good search engines *cough*Google*cough* will take the querystring in=
to =
consideration while indexing.
2) For sake of ease, scalability, and security you may want to build a =
querystring like ?id=3D1, instead of ?page1. Then you can read the page =
id =
with $_GET['id'].
3) Using this method of including, you should perform a check on file =
existence.
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
[Back to original message]
|