Hi,
On my site I have 22 pages, and on each page I have links to all the others. So when I add, edit or remove a page I have to edit all 22 pages. I was wondering if there was a way to have the links kept in one file on my server, and have the links from that file show up as links on all my pages.
If you enable PHP on your host, it really is extremely simple to do what you are saying.
All you need is an include file with the links defined as constants.
For example, if you want to reference index.htm then think of a name to call it, home say, then create a text file called something like "links.inc" and define home as a constant who's value is index.htm
<?php
define ('home','index.htm');
?>
Just add more lines for more constants.
Then in your html pages you then place the line
<?php include(links.inc) ?>
And in each html file you replace each link with the appropriate constant..
I have found that I can use Framesets to have a different page that I just show after the main page. How do I make it show up UNDER the main page, but off screen untill I scroll down to where it would be if it were one page...
Framesets are EVIL!!! very bad business... avoid... avoid... avoid... 666 - mark of the beast - etc... I've dealt with them before, I thought they were "easy to manage". The best way to go is php includes.
-Mike
It's really rather simple. Include all your links in a separate document. Name it whatever you like, links.txt or what-have-you. Now, in your pages, make sure it's got a php extension (.php instead of .html) and where you want the links to be, put this:
Ok, I figured out how to do it using the unclude function, given above.
Although this does not do what I want, I still have to manually add links to every page. I want it to just list all the links from the links.inc file, at the bottom of every page.
and to test it, main.php looks like:
<?php include("http://home.austarnet.com.au/caradonhouse/down.htm") ?>
<?php include("http://swiftless.thefreebizhost.com/Test/hmm/links.inc") ?>
<?php echo home; ?>
<?php echo contact; ?>
but i want it to echo all the files in the links.inc at once, instead of all manually as you can see with:
<?php echo home; ?>
and
<?php echo contact; ?>
I just found out that the page CANNOT have an extension of .php, as this will stop all search engines and links to the site from working. Is there any way to leave the name of the page as .html?
Bookmarks