Jump to content

single page with referrer to show correct page


lkbolt

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);

}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.