View Full Version : Page Layout?

01-23-2008, 07:09 PM
I making a php website and i was going to use framesets for the layout but then i decided not to so i say that some sites use some sort of layout also like framesets but its not! So i want to make my site index url like index.php?page=news and in the index have it get the $page variable and include news.php there! It does include it but when i interact with the new page i goes to the new.php page and then my menu and banner is not shown!

Is there anyway to fix this or do php have its own frameset like scripts avaliable?


01-24-2008, 01:23 AM
Maybe you mean that you want to 'include' the file news.php when the index.php?page=news is that right?
Easy to do, assuming that 'news.php' has output to the browser, or can be fetched and dumped into the scope of the index.php script:

if (isset($_GET['page']))
$file = '/path/to/my/files/' . $_GET['page'] . '.php';
if (is_readable($file))
include $file;

Hmm, something seems a little off about that, someone please confirm for me, I'm having a bad programming day :P
Is that kinda what you are looking for?