Jump to content


Photo

PHP, Lnking and possibly a silly question


  • Please log in to reply
1 reply to this topic

#1 Mouse

Mouse
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts
  • LocationToo Close to LONDON

Posted 11 November 2005 - 08:29 PM

<div id="sectionLinks">
<h3>Section Links</h3>
<ul>
<li><a href="Page1.htm”>Page1</a></li>
<li><a href="Page2.htm">Page 2</a></li>
<li><a href="Page3.htm">Page 3</a></li>
<li><a href="Page3.htm">Page 4</a></li>
<li><a href="Page3.htm">Page 5</a></li>
<li><a href="Page3.htm">Page 6</a></li>

</ul>
</div>
<div class="relatedLinks">
<h3>Community Links </h3>
<ul>
<li><a href="tellafriend.php">Tell a friend</a></li>
<li><a href="help.htm">Need help?</a></li>
<li><a href="donate.htm">Please Donate</a></li>
</ul>
</div>

Hello, quick question…

The above is a section from my site, it makes up the links found down the left hand navigation column. As there are an ever-increasing number of pages, but all of them share this code in common.

I assume that there is a way of calling the links from an external file so that I can change just one file and have the changes cascade across the site.

How do I format the text for both the lines of code to call in the external links and how do I format the lines of code in the external file?

And lastly will any of this be affected by being used on HTML and PHP pages???

Mouse

#2 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 14 November 2005 - 12:01 PM

If you are making your site in PHP then this should work wonders:
<?php include(includes/nav.php); ?>

With nav.php being a page that holds all of your nav links. Alternatively, you could go to the HTML area on the Insert bar and select "Include File" and select an HTML file for a pure-HTML solution.
Disclaimer: No matter how harsh I may be, I'm always IMO only.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users