Forum Moderators: coopster
Example...
www.example.com/dirA/pageA.php
www.example.com/dirB/pageB.php
www.example.com/includes/includedfile.php
On both pages I would like to include the same file, and inside that file I would like to determine which directory the 'calling' page is located in. I would then use a switch statement to execute the appropriate code.
Something like...
switch ($directoryName)
{
case "dirA":
....
break;
case "dirB":
...
break;
...
}
Is this possible or am I going about this entirely the wrong way :)?
Thanks.
What I would do is insert a phpinfo() [uk.php.net] in your included file; have a look at the global variables available to your script and see which would be the easiest one to use in your situation.