You are here: Header link advice « HTML « IT news, forums, messages
Header link advice

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация