View Single Post
Old 08-23-2008, 03:32 AM   #20 (permalink)
Kalle
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Quote:
Originally Posted by sketchMedia View Post
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__)));
?>
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote