PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
If you wanted to include navigation code in multiple web pages, that would be used by pages on the site root as well as subdirectories, how would you make the image links resolve from anywhere?
Would you use absolute URL's?
Or is there a better way?
use a frame set
'quicklly ducks for cover under desk and awaits the beating that he knows is coming':lol:
Absolute URL's would work but it would be slower.
carfully lay out your file system?
use PHP to dynamically create the links depending on how far down the directory structure you need to go.
'ducks agian to avoid the coffee mug being thrown at him'
I was thinking about using a $GLOBALS var that holds the site root in a config file, then dynamiclly build my links.
<img src="<?=$GLOBALS['site_root'] ?>/assets/images/pic.gif">