Jump to content

PHP, Lnking and possibly a silly question


Recommended Posts

<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

Link to comment
https://forums.phpfreaks.com/topic/2847-php-lnking-and-possibly-a-silly-question/
Share on other sites

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.

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.