Jump to content
xisto Community
Sign in to follow this  
delivi

Php Help Needed Including File In A Page.

Recommended Posts

i'm a noob in php programming, i can understand and modify php programs, but i dont know to write on my own. So please somebody who is well versed in php help me. My need is,

I'm currently builiding a knowledge base website , i've my own design for the website, check here, http://forums.xisto.com/no_longer_exists/

Each page in the left hand site has a tree navigation of all the topics available. Since this information must be same in all the pages, presently I need to change all the pages after adding a new category. Could you please help me in such a way that I can add this content in one file, say a text document and that will be updated to all the pages, by including the file in all the pages.

the tree list coding contains only a set of html ul and li tags. please help me.

can this be done using server side includes, if so please provide information.

Share this post


Link to post
Share on other sites

Just create a file don't matter the name.Then take the code from the navigation and put it in that page.Then on the pages were you want the navigation to appear put this: <?php include("menu.php"); ?>But make sure the pages with "<?php include("menu.php"); ?>" are saved as a .php file.Good luck.

Share this post


Link to post
Share on other sites

Just create a file don't matter the name.

 

Then take the code from the navigation and put it in that page.

 

Then on the pages were you want the navigation to appear put this: <?php include("menu.php"); ?>

 

But make sure the pages with "<?php include("menu.php"); ?>" are saved as a .php file.

 

Good luck.

To be more precise:

Cut the "tree list" code, make a new file named "menu.html" or "menu.php" or "menu.txt" or whatever in the same directory, and paste the "tree list" code into that newly-created file.

Then, on the page on the same spot the "tree list" code was at, place the following:

<?php include("menu.html"); ?>
Where menu.html is the name of the file you created.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.