Posted by Alan Jones on 05/14/07 23:36
On Tue, 15 May 2007 07:20:47 +1000, David Cain <david@shesurf.ws>
wrote:
>I am just wondering if there is a PHP function that returns the file
>name or domain name of where the file/script is located that called the
>PHP script in question?
>
>Thanks in advance.
$_SERVER used with one of several reserved variables will do that.
I like... $_SERVER['PHP_SELF']
Here's how you might use it...
<?php if ($_SERVER['PHP_SELF'] == '/index.php')
{include('signature.php');}?>
[Back to original message]
|