On 3/28/2011 9:18 PM, Jack wrote:
Hello All,



Is there a smarter way to do includes by setting up a path or something
where I don't have to include /home/domain.com/includes/include_file.php

Apparently my path is as shown above,  but I would prefer to just put in
/includes/include_file.php





Thanks!

Jack





Here's how I do it. For every application, I have a config file with all my
common assignments, including common paths, e.g.,

define('EDITPAGE_ROOT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/editPageSR/');
define('EDITPAGE_IMAGES_DIR', EDITPAGE_ROOT_DIR . 'images/');
define('EDITPAGE_DATA_DIR', PAGE_ROOT_DIR . '/editPageFiles/');

So, in your case, I'd have

define('INCLUDE_FILE', $_SERVER['DOCUMENT_ROOT'] . "/includes 
/include_file.php");

So all I need is to use INCLUDE_FILE

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to