View Single Post
Old 05-20-2007, 6:33 PM   #5
Alan Jones
 
Alan Jones's Avatar
 
Posts: n/a
My Photos: ()

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Calling PHP file

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');}?>

  Reply With Quote