I'm dealing with an outdated PHP4 IIS server which has odd settings and I absolutely cannot update PHP or modify any server settings.
This legacy site on the server basically has subdirectories which have an includes
directory so there are multiple includes
directories, and in my root I do something like
include 'includes/nav.php';
There are around 10 nav.php
files in includes
directories throughout, so sometimes the wrong one gets pulled in.
I found a workaround by just prefixing the absolute local filesystem path to it, eg
$base = dirname(__FILE__);
include $base . '/includes/nav.php';
However, in order to apply the fix I'd have to alter pretty much every file.
Every file includes the same configuration file though. Is there some ini function trick I could use so that each subdirectory grabs its respective include file from its relative directory path instead of other includes directories?