lkbolt Posted October 14, 2009 Share Posted October 14, 2009 I have a simple website with a couple of different pages. I would like to be able to in a div tag with a php require or even inside the same page be able to show whatever link is clicked on that part of the page is shown. this is kinda of difficult to explain. What I am trying to do is get the entire site down to 1 or 2 pages. with all content in the content part of the page being presented by whatever link is clicked. Quote Link to comment Share on other sites More sharing options...
trq Posted October 14, 2009 Share Posted October 14, 2009 And your problem is? Quote Link to comment Share on other sites More sharing options...
lkbolt Posted October 14, 2009 Author Share Posted October 14, 2009 how do I incorporate my whole site, all my pages home about services contact into one or 2 pages. I have the front page built I have a content area that I would like to be able to show all pages in it and not a frame maybe have a 2nd page with functions to call each page to the content area and have a php require in the content area. I just not sure how to do this or where to start I have used php scripts and understand how they work most of the time I am just not sure how to start on this project. Quote Link to comment Share on other sites More sharing options...
lkbolt Posted October 19, 2009 Author Share Posted October 19, 2009 I found what I was looking for here is how I got it done. I put the following code into the content <div> Tag on my main index.php page where I wanted each page to show its content: <?php $page=array(1=>'page1.php',2=>'page2.php',3=>'page3.php'); if(isset($_GET['id'])){ $PageToInclude=(isset($page[$_GET['id']]))?$page[$_GET['id']]:"errorpage.php"; //errorpage.php included if someone messes with the url. include($PageToInclude); } else { $homepage='home.php'; include($homepage); } ?> Quote Link to comment 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.