Posted by Stefan Rybacki on 07/02/05 16:47
Jonathan Davis wrote:
> Hello,
>
> I am looking at converting my webpage to use php includes to save time in
> updating the site. I would like to setup a template for the design and use a
> php include to add the content into the page.
>
> I was looking at something like:
>
> www.domain.com/index.php?page.php
> or
> www.domain.com/index.php?news/newspage.php
First of all you shouldn't do it that way, because of security.
Better use something like www.domain.com/index.php?page=11111
where you can determine what page with 11111 is meant.
in index.php
$page_array=array('11111'=>'page.php');
include($page_array[$_REQUEST['page']]);
But note that isn't the right way anyway, at least you have to check
whether the requested page is available.
You also could use a real template system like smarty or try to
implement one for your own.
>
> So the first url would include the content from page.php within say a table
> in index.php
> And the second would include the content from newspage.php.
>
> The content would always be in the same place on the index page so is there
> is a php include i could use that would achieve this?
>
> thanks, Jonathan
>
Regards
Stefan
>
[Back to original message]
|