Jump to content

Calling content from another page


Jetheat

Recommended Posts

I have a template page called template.php.

It contains the header, left nav bar, right nav bar and the footer.

So the only place available for content is the middle (inside a table).

 

Now, I want relevant content displayed in the middle of this page depending on which link the user clicks on the nav bars.

 

The content for each link will be contained in another file in another folder.

 

So if the user clicks on the "about us" link, the php should display the contents of the /mainfolder/about.php file.

 

So, in the middle of teh template page, I have placed some code which says:

 

<!-- content -->
<div id="content">
{{content}}
</div>

Now all I need to do is define what "content" is and call it, right?

My about page consists of a lot of html. How do I get that whole page to display within the center of my template page and yet the user sees about.php in their address bar.

Furthermore, my template.php references a stylesheet in the same folder.
All the pages which are called into the middle of the template page are in other folders on my server and if they are requested, then the reference to the stylesheet is not there anymoe.

How do I solve this?

Appreciate the help.

JH

Link to comment
https://forums.phpfreaks.com/topic/90685-calling-content-from-another-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.