Results 1 to 3 of 3
Feb 9, 2012, 07:11 #1
- Join Date
- Jan 2012
- 0 Post(s)
- 0 Thread(s)
universal include header.php if possible, please
I wanna make universal header/footer include files.
Universal here means to be applicable in files on any directory level without need to add “../” at any deeper level when calling “header.php” from “includes” directory.
Ok, fine. I can use
<?php include $_SERVER[‘DOCUMENT_ROOT’].”/includes/header.php”;?>
to have it anywhere but the header.php contains a relative reference to a .css file and the .css file contains its relative references (for instance “background: url(../images/o.gif);” and all that lands me in a quagmire of “../../” at every new level.
Of course, I could replicate the .css and ../images at every level yet it seems a bit awkward and contrary to the very principle and spirit of the great php (control all at one place).