Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Php Help Needed Including File In A Page.
delivi
post Feb 3 2007, 12:22 AM
Post #1


Trap Grand Marshal Member
***********

Group: [HOSTED]
Posts: 1,314
Joined: 11-January 06
From: Chennai, India
Member No.: 16,932



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://laschatz.info/kzone/

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.
Go to the top of the page
 
+Quote Post
Mystixs
post Feb 3 2007, 12:52 AM
Post #2


Member [Level 1]
****

Group: Members
Posts: 57
Joined: 23-January 07
Member No.: 37,683



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.
Go to the top of the page
 
+Quote Post
truefusion
post Feb 3 2007, 02:52 AM
Post #3


Ephesians 6:10-17
Group Icon

Group: [MODERATOR]
Posts: 1,918
Joined: 22-June 05
From: The World of Gentoo
Member No.: 8,528



QUOTE(Mystixs @ Feb 2 2007, 07:52 PM) *
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:
CODE
<?php include("menu.html"); ?>
Where menu.html is the name of the file you created.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Getting List Of Directories And Files Using Php(6)
  2. Script: Php Jukebox(4)
  3. I Need Help With File Edit In Php(6)
  4. Include File.php?id=something(13)
  5. Php - Fsockopen, Get, Etc - Help Needed(1)
  6. Help Php: How To Load String From Text File (solved)(9)
  7. Edit .txt File In Ftp Via Webpage(2)
  8. Ipetsite Related Programming Help Needed(0)
  9. [php]simple Flat File Text Manipulator(3)
  10. Creatting A Playlist Through Php(5)
  11. <?php ?> Unique Visitors Script(2)
  12. File Upload(1)
  13. No File Extension(3)
  14. Php And Flash Image Gallery(5)
  15. Wamp Packages Needed To Test Scripts(1)
  1. File Checker-how To Check File Whith Html Through Html?(2)
  2. Slaed Cms(2)
  3. Php Code(15)
  4. Php Code Needed(5)
  5. Looking For Command Line Based Sql Modification(1)
  6. Php Code Needed Iii(10)
  7. Updating Php File Through A Web Form(5)
  8. Tools Needed!(9)
  9. Admin Page(4)
  10. Need Some Help In File Browser(8)
  11. Php Configuration File(16)
  12. Tutorial Needed?!(11)
  13. Linux/ Apache /mod_rewrite Issue(4)


 



- Lo-Fi Version Time is now: 13th October 2008 - 05:29 PM