chrischris
New Member
Hi
I'm using PHP includes but I have a question about link references.
Do I have to change the reference manually for every new page I make? Or can I have a line of code which works for all pages, regardless of which folder they are in?
I understand about absolute, doc relative and root relative references but nothing I try seems to work...If I try a root relative on one page which works it doesn't seem to work for a page at another folder level in the directory.
<?php include 'includes/header.php'?>
<?php include '/includes/header.php'?>
<?php include './includes/header.php'?>
<?php include '/sitename/includes/header.php'?>
<?php include '../includes/header.php'?>
<?php include '../../includes/header.php'?>
Any help here guys? Bit confused - if the case is that every page's code needs to be different then how can I maintain a large database driven site easily?
Thanks
Chris
I'm using PHP includes but I have a question about link references.
Do I have to change the reference manually for every new page I make? Or can I have a line of code which works for all pages, regardless of which folder they are in?
I understand about absolute, doc relative and root relative references but nothing I try seems to work...If I try a root relative on one page which works it doesn't seem to work for a page at another folder level in the directory.
<?php include 'includes/header.php'?>
<?php include '/includes/header.php'?>
<?php include './includes/header.php'?>
<?php include '/sitename/includes/header.php'?>
<?php include '../includes/header.php'?>
<?php include '../../includes/header.php'?>
Any help here guys? Bit confused - if the case is that every page's code needs to be different then how can I maintain a large database driven site easily?
Thanks
Chris