O.P. Other PHP question...
Hi all, working on a PHP file, I include a file, which has a link, let's say:
in a.php:
$a = '<a href="index.php">Index</a>';
and in all other files in the same directory:
include 'a.php';
But, when I have files in other folders I use:
include '../a.php';
but index.php is not in that folder and I get an error.
This was a simple explanation, really need that file to be the only one with the link, so I can't just added in each page.
Is there any php function that detect in which folder the file is? In big, because that's the really question.
something like:
echo $_SERVER['DOCUMENT_ROOT']
// But DOCUMENT_ROOT will echo the complete path, and not just the folder.
The document root directory under which the current script is executing, as defined in the server's configuration file.
This post was edited on 06-20-2004 at 11:07 PM by leito.
|