With some assistance from Nibbler I now have cpg nicely integrated into my web site. Just one feature doesn't work.
I use a PHP script to dynamically generate my Navigation Bar which is called as part of {CUSTOM_HEADER} - it mostly works fine. However there are a couple of places in the script where I check the calling URL so that I can highlight the current page in the Navigation Bar, and I can generate a "breadcrumb" string. Neither of these elements work.
I'm using: $url=$_SERVER['PHP_SELF']; to pick up the URL, but if I echo $url at this point in the script it is null.
I could just hard-code the Navigation Bar for the gallery page, but it would be nice to use the script if possible. Any ideas what might be wrong?
Steve
We overwrite $_SERVER['PHP_SELF'] in init.inc.php, although it shouldn't be null. You can use $ORIGINAL_PHP_SELF instead which contains the original value.
Nibbler,
$ORIGINAL_PHP_SELF also seems to be null.
If I simply insert echo $ORIGINAL_PHP_SELF early in my script would I expect to see something? I'm no expert on PHP but could it be something to do with declaring variables as Global?
Thanks for your help.
Steve
Yeah, if you use it inside a function you need to global it.
Nibbler,
Perfect! A global declaration fixed it. Guess I need to take some more PHP lessons :)
Thanks for your help.
Steve