birdbrain24 Posted January 23, 2008 Share Posted January 23, 2008 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? Thanks ~birdbrain24 Quote Link to comment https://forums.phpfreaks.com/topic/87422-page-layout/ Share on other sites More sharing options...
obsidian Posted January 23, 2008 Share Posted January 23, 2008 All that it takes to accomplish what you are after is a simple understanding of includes. Something like this is what you are after: <?php // All your header code goes here $page = isset($_GET['page']) ? $_GET['page'] : ''; switch ($page) { case 'news': include('news.php'); break; default: include('main.php'); } // All your footer code goes here ?> Quote Link to comment https://forums.phpfreaks.com/topic/87422-page-layout/#findComment-447131 Share on other sites More sharing options...
birdbrain24 Posted January 23, 2008 Author Share Posted January 23, 2008 thanks i'll try it! it seems like it code works Quote Link to comment https://forums.phpfreaks.com/topic/87422-page-layout/#findComment-447136 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.