Base Directory?!

For a while now I used something like the following to get a good include() path for my PHP code.

if (!defined("BASE_PATH")) define('BASE_PATH', $_SERVER['DOCUMENT_ROOT'].'/mrp'));

However, I was hit with the realization that it won't work with my new Apache setup, which goes something like the following:

ServerRoot "X:/home/abdallah/xampplite/apache"
DocumentRoot "X:/home/abdallah/xampplite/htdocs"
     Alias /mrp "X:varwwwmanufac"
    AllowOverride None
    Options all
    Order allow,deny
    Allow from all

So, $_SERVER['DOCUMENT_ROOT'] no longer works!
Instead I've reverted to something like the following:

if (!defined("BASE_PATH")) define('BASE_PATH', substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), 'mrp')+3));

Similar Posts:

    None Found

No Comments

You can leave the first : )