Navigation...

  • Jako
  • Banned
  • Banned
  • Jako
  • Posts: 227

Post 3+ Months Ago

I know this is possible cause my friend used it on his site. But when he explained it I got confused.

I want to keep the navigation on each page the same. He said he used php_include codes, but I am not sure how to do this. I want it so when I update the navigation, it gets updated for each page w/o having me to go manually into each page and adding each link.
  • CazpianXI
  • Proficient
  • Proficient
  • User avatar
  • Posts: 285

Post 3+ Months Ago

Jako, here's what you do.

Open up your page's HTML source and CUT (not copy) the navigation for your site. Paste it into a file. Then, just replace the code you just cut out with:

PHP Code: [ Select ]
 
<?
 
include "filename";
 
?>
 
 
  1.  
  2. <?
  3.  
  4. include "filename";
  5.  
  6. ?>
  7.  
  8.  


Where filename is the path to the new file you just created.

Hope this helps!

~Cazpian the 11th
  • Jako
  • Banned
  • Banned
  • Jako
  • Posts: 227

Post 3+ Months Ago

thanks a ton...let me try this out and I'll get back to you.
  • CazpianXI
  • Proficient
  • Proficient
  • User avatar
  • Posts: 285

Post 3+ Months Ago

Glad to be of service!

~Cazpian the 11th
  • MasterSlowPoke
  • Newbie
  • Newbie
  • MasterSlowPoke
  • Posts: 7
  • Loc: Tampa

Post 3+ Months Ago

Make sure that the filename has the extentsion .php, not .html, and that your server supports php. You won't be able to test this on your machine unless you set up an apache server or something.
  • CazpianXI
  • Proficient
  • Proficient
  • User avatar
  • Posts: 285

Post 3+ Months Ago

Ah, yes MasterSlowPoke.

Thanks for mentioning that. I forgot that not everyone here knows PHP :blush:

BTW: You can name the file .php or .inc -- either one will work. Usually, it is a good practice to name your files .inc for external files that are being included.

By included, I mean:

PHP Code: [ Select ]
 
<?
 
include "thisexternalisbeingincluded.inc";
 
?>
 
 
  1.  
  2. <?
  3.  
  4. include "thisexternalisbeingincluded.inc";
  5.  
  6. ?>
  7.  
  8.  


~Cazpian the 11th

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.