For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > October 2005 > Get the path to a "parent" script?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Get the path to a "parent" script?
Bonge Boo!

2005-10-22, 6:56 pm

I hope this is easy. I'm trying to move a load of code out from the "parent"
page into includes to make things a bit tidier.

I make a variable called $target from the $_SERVER[SCRIPT_NAME]; I then use
$target in a function run some tests against an array, if they match they do
some conditional code to make a navigation bar.

I thought I would be able to make $target a globalvariable so my include
scripts could then access it and use its value. However this didn't work.
Might be me being thick.

So the next approach would be to have the includes able to know what the
"parent" file was called, and then I could use that. Reading the manual
hasn't thrown up an obvious functions or global variables.

Anyone? Do I need to go back and find out why my global variable wasn't
working?



Bonge Boo!

2005-10-22, 6:56 pm

Ignore that, I'm a moron.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com