Posted by Confused but working on it on 09/20/07 16:09
Good Morning,
I have a reasonably simple site hat I've started to organize a bit
better. Most everything was in the main directory, same as the index
file. I use a header and footer PHP include on every page and just
realized that the links in my header file give a 404 error.
From the index page I link to /dogs/poodles/poodles.php
In poodles.php i include:
<?php include("../../header.php"); ?>
The ../../ get the header file from the main directory of the site.
So now the hader thinks the other site files are in the poodles
directory when in reality most are still in the same as index.
My solution is to have multiple header files like:
<?php include("header.php"); ?>
<?php include("../header1.php"); ?>
<?php include("../../header2.php"); ?>
<?php include("../../../header3.php"); ?>
and then inside of each header file rework the links. This would work
and pick how deep the calling file is. But this would be dumb as I
would have to change 4 header files.
I have an older HTML4 book but it doesn't really touch on this. Am I
missing something amazingly simple?
TIA,
Ron
[Back to original message]
|