[nycphp-talk] who's calling me?
David Krings
ramons at gmx.net
Mon Jul 23 19:08:54 EDT 2007
Rahmin Pavlovic wrote:
> Say I'm an include. Say several templates include me into what will become
> a single web page. How can I tell which template is calling me?
>
The easiest way is when the template identifies itself. I use a script
for output in two contexts and want to make sure to return to the right
place. I registered the path of the calling script with the session and
use that to figure out what to do and where to go.
There may be also a way to use the $_SERVER array, I think one element
includes the name of the calling page. I tend not use $_SERVER as it
contains different things with different names or sometimes not that
much on various servers.
David
More information about the talk
mailing list
Automatic Email Organization without missing anything!