08-23-2008, 03:32 AM
|
#20 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
|
Quote:
Originally Posted by sketchMedia
To get the current document path you could use this:
PHP Code:
define('SITE_ROOT', dirname(__FILE__));
and you could also use realpath so that you can go up a directory etc:
PHP Code:
define('SITE_ROOT', realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR));
|
Or use the magic __DIR__ compile time constant as of PHP 5.3 :):
PHP Code:
<?php
define('SITE_ROOT', (defined('__DIR__') ? __DIR__ : dirname(__FILE__)));
?>
__________________
|
|
|